]> git.scottworley.com Git - srec/commitdiff
Tee webcam video to two virtual cameras master
authorScott Worley <scottworley@scottworley.com>
Mon, 6 Oct 2025 17:40:23 +0000 (10:40 -0700)
committerScott Worley <scottworley@scottworley.com>
Mon, 6 Oct 2025 17:40:23 +0000 (10:40 -0700)
srec.py

diff --git a/srec.py b/srec.py
index 7421c74cc764f8642c3d4a5766c890ade5e044d6..962c147045b95ecbf76a0bca5dfca2b66e4cf5be 100644 (file)
--- a/srec.py
+++ b/srec.py
@@ -111,9 +111,14 @@ def on_start_recording(_: Gtk.Button, stack: Gtk.Stack) -> None:
     stack.set_visible_child_name("recording")
 
     if is_sharing_enabled(stack):
     stack.set_visible_child_name("recording")
 
     if is_sharing_enabled(stack):
+        out_opts = [
+            '-f', 'v4l2', '-framerate', '25', '-codec:v', 'rawvideo',
+            '-pix_fmt', 'yuv420p',
+        ]
         sharing = Stream.start(
         sharing = Stream.start(
-            ['ffmpeg', '-i', '/dev/video0', '-f', 'v4l2', '-framerate', '25',
-             '-codec:v', 'rawvideo', '-pix_fmt', 'yuv420p', '/dev/video9'])
+            ['ffmpeg', '-i', '/dev/video0']
+            + out_opts + ['/dev/video8']
+            + out_opts + ['/dev/video9'])
         time.sleep(3)  # Bad!!  We should not be sleeping in this thread!
 
     recording = Stream.start(
         time.sleep(3)  # Bad!!  We should not be sleeping in this thread!
 
     recording = Stream.start(