initial commit
Change-Id: I52a95dcee12a1d52e630f7e8074b7dd2160cda40
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..8392d15
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ff51edf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.direnv
\ No newline at end of file
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..78a687c
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=ssh.clicks.codes
+port=29418
+defaultbranch=main
+project=Clicks/AutoPi.git
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..d415d0f
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,61 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1694529238,
+ "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1701174899,
+ "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..d224f21
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,27 @@
+{
+ description = "A basic flake with a shell";
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ inputs.flake-utils.url = "github:numtide/flake-utils";
+
+ outputs = { nixpkgs, flake-utils, self }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in
+ {
+ devShells.default = pkgs.mkShell {
+ packages = [ pkgs.poetry (pkgs.python311.withPackages (pyPkgs: [
+ pyPkgs.numpy
+ (pyPkgs.buildPythonPackage rec {
+ pname = "python-twitch-stream";
+ version = "1.0.2";
+ format = "wheel";
+ src = builtins.fetchurl {
+ url = "https://files.pythonhosted.org/packages/3c/1c/fb821e36fa40316442f59c152d1632a46fceedd04056707c8950159d0671/python_twitch_stream-1.0.2-py2.py3-none-any.whl";
+ sha256 = "sha256-1fx0c1r31lcrckl897v2hyw679v9zacsrmfm10bhswz050zs9ch3";
+ };
+ })
+ ])) pkgs.ffmpeg ];
+ };
+ });
+}
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..54bfb6d
--- /dev/null
+++ b/main.py
@@ -0,0 +1,24 @@
+from __future__ import print_function
+from twitchstream.outputvideo import TwitchBufferedOutputStream
+import numpy as np
+
+if __name__ == "__main__":
+ with TwitchBufferedOutputStream(
+ twitch_stream_key="live_997764549_DZ2u2aAJTz7VFGASm8REuzeLyhRUzA",
+ width=1920,
+ height=1080,
+ fps=30.,
+ verbose=True,
+ enable_audio=True) as videostream:
+
+ frame = np.zeros((480, 640, 3))
+
+ while True:
+ if videostream.get_video_frame_buffer_state() < 30:
+ frame = np.random.rand(1080, 1920, 3)
+ videostream.send_video_frame(frame)
+
+ if videostream.get_audio_buffer_state() < 30:
+ left_audio = np.random.randn(1470)
+ right_audio = np.random.randn(1470)
+ videostream.send_audio(left_audio, right_audio)
\ No newline at end of file
diff --git a/sakuratree.mp4 b/sakuratree.mp4
new file mode 100644
index 0000000..43ec6f6
--- /dev/null
+++ b/sakuratree.mp4
Binary files differ