-def on_start_recording(_: Gtk.Button, stack: Gtk.Stack) -> None:
- global recording # pylint: disable=global-statement
- assert recording is None
-
- filename = make_filename()
- size_display = find_size_display(stack)
-
+def begin_monitoring_file_size(size_display: Gtk.Label, filename: str) -> None:
return GLib.SOURCE_REMOVE if recording is None else GLib.SOURCE_CONTINUE
GLib.timeout_add_seconds(1, update_size_display)
return GLib.SOURCE_REMOVE if recording is None else GLib.SOURCE_CONTINUE
GLib.timeout_add_seconds(1, update_size_display)
+
+def on_start_recording(_: Gtk.Button, stack: Gtk.Stack) -> None:
+ global recording # pylint: disable=global-statement
+ assert recording is None
+
+ filename = make_filename()
+ begin_monitoring_file_size(find_size_display(stack), filename)
+
recording = Stream.start(
['ffmpeg', '-framerate', '25'] + video_source(stack) +
['-f', 'pulse', '-ac', '2', '-i', 'default', filename])
recording = Stream.start(
['ffmpeg', '-framerate', '25'] + video_source(stack) +
['-f', 'pulse', '-ac', '2', '-i', 'default', filename])