- command = (['ffmpeg', '-framerate', '25'] + video_source(stack) +
- ['-f', 'pulse', '-ac', '2', '-i', 'default', filename])
- # pylint: disable=consider-using-with
- recording = Recording(
- filename=filename,
- process=subprocess.Popen(command, stdin=subprocess.PIPE))
+ size_display = find_size_display(stack)
+
+ def update_size_display() -> Any:
+ try:
+ size = summarize_size(os.stat(filename).st_size)
+ except FileNotFoundError:
+ size = '--'
+ size_display.set_label(f'<big>{size}</big>')
+ return GLib.SOURCE_REMOVE if recording is None else GLib.SOURCE_CONTINUE
+ GLib.timeout_add_seconds(1, update_size_display)
+
+ recording = Stream.start(
+ ['ffmpeg', '-framerate', '25'] + video_source(stack) +
+ ['-f', 'pulse', '-ac', '2', '-i', 'default', filename])