+ if is_sharing_enabled(stack):
+ out_opts = [
+ '-f', 'v4l2', '-framerate', '25', '-codec:v', 'rawvideo',
+ '-pix_fmt', 'yuv420p',
+ ]
+ sharing = Stream.start(
+ ['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(
+ ['ffmpeg', '-framerate', '25'] + video_source(stack) +
+ ['-f', 'pulse', '-ac', '2', '-i', 'default', filename])
+
+
+def stop_streams() -> None:
+ global recording, sharing # pylint: disable=global-statement
+ if recording is not None:
+ recording.stop()
+ recording = None
+ if sharing is not None:
+ sharing.stop()
+ sharing = None
+
+
+def on_stop_button(_: Gtk.Button, stack: Gtk.Stack) -> None: