diff --git a/streaming/output.py b/streaming/output.py index c273bd1..1d820d5 100644 --- a/streaming/output.py +++ b/streaming/output.py @@ -181,6 +181,10 @@ class FileOutput(Output): if audio_source: cmd.extend(["-c:a", "aac", "-b:a", "192k", "-shortest"]) + # Use fragmented mp4 for streamable output while writing + if str(self.path).endswith('.mp4'): + cmd.extend(["-movflags", "frag_keyframe+empty_moov+default_base_moof"]) + cmd.append(str(self.path)) import sys