Has flag hybrid_fragmented flag (yet) been added to ffmpeg release?
The hybrid_fragmented flag is used to enable viewers to read an mp4 file while it is being wrtitten according to the documentation here: https://ffmpeg.org/ffmpeg-formats.html But has it been released yet and in that case from which version is it available? I really need to be able to start viewing mp4 files before they are closed by the writer.... -- Bo Berglund Developer in Sweden
On Wed, 11 Jun 2025 20:54:06 +0200, Bo Berglund <bo.berglund-at-gmail.com@ffmpeg.org> wrote:
The hybrid_fragmented flag is used to enable viewers to read an mp4 file while it is being wrtitten according to the documentation here: https://ffmpeg.org/ffmpeg-formats.html
But has it been released yet and in that case from which version is it available? I really need to be able to start viewing mp4 files before they are closed by the writer....
So now 3+ months later and noone seems to know about this? Will this flag ever be available to the public using Linux? Or is it available, but only if one uses some special installation of ffmpeg (I am using the standard apt delivered ffmpeg on Ubuntu Server 24.04.3 LTS) TIA -- Bo Berglund Developer in Sweden
On 24.09.2025 09:54, Bo Berglund via ffmpeg-user wrote:
On Wed, 11 Jun 2025 20:54:06 +0200, Bo Berglund <bo.berglund-at-gmail.com@ffmpeg.org> wrote:
The hybrid_fragmented flag is used to enable viewers to read an mp4 file while it is being wrtitten according to the documentation here: https://ffmpeg.org/ffmpeg-formats.html
But has it been released yet and in that case from which version is it available? I really need to be able to start viewing mp4 files before they are closed by the writer....
So now 3+ months later and noone seems to know about this?
Will this flag ever be available to the public using Linux?
Or is it available, but only if one uses some special installation of ffmpeg (I am using the standard apt delivered ffmpeg on Ubuntu Server 24.04.3 LTS)
TIA
https://github.com/FFmpeg/FFmpeg/commit/6ec22731ae7694d4db08fff556eea58aa3b9...
On Wed, 24 Sep 2025 20:15:06 +0200, Timo Rothenpieler via ffmpeg-user <ffmpeg-user@ffmpeg.org> wrote:
On 24.09.2025 09:54, Bo Berglund via ffmpeg-user wrote:
On Wed, 11 Jun 2025 20:54:06 +0200, Bo Berglund <bo.berglund-at-gmail.com@ffmpeg.org> wrote:
The hybrid_fragmented flag is used to enable viewers to read an mp4 file while it is being wrtitten according to the documentation here: https://ffmpeg.org/ffmpeg-formats.html
But has it been released yet and in that case from which version is it available? I really need to be able to start viewing mp4 files before they are closed by the writer....
So now 3+ months later and noone seems to know about this?
Will this flag ever be available to the public using Linux?
Or is it available, but only if one uses some special installation of ffmpeg (I am using the standard apt delivered ffmpeg on Ubuntu Server 24.04.3 LTS)
TIA
https://github.com/FFmpeg/FFmpeg/commit/6ec22731ae7694d4db08fff556eea58aa3b9...
So that is a *description* of why you need it (in my case I want to read an unfinished mp4 while it is being downloaded). Now I have grabbed the very latest ffmpeg nightly from github and symlinked it to be the on-path ffmpeg on one of my Linux machines and it does work for my ordinary scripts to get the mp4 downloads working. So I am on the bleeding edge of ffmpeg on that device. But I have totally failed in using it with movflags, probably due to the lack of instructions on *how* to activate that flag... So please give me an example command for ffmpeg download where it is used successfully to allow reading while writing the mp4 file. I use this ffmpeg command in my download script today where I am forced to save into a ts file because of the inability to read it if it is set to mp4 and I want to modify it to use the new flag to allow me to download into an mp4: CMD="ffmpeg -hide_banner -loglevel warning ${MODE} -i \"${M3U8URL}\" -r 30 -vf scale=w=-4:h=480 -c:v libx264 -preset fast -crf 26 -x264-params keyint=30:scenecut=0:open-gop=0 -c:a aac -t ${CAPTURETIME} -f mpegts ${TARGETFILETS}" The variables are: MODE = "-referer \"${VIDEOURL}\"" VIDEOURL = https URL of the webpage hosting the player M3U8URL = the m3u8 of the video stream CAPTURETIME = download time in seconds TARGETFILETS = the ts video file name which I want to be an mp4 instead I have tried adding this command before the -i argument: movflags=+hybrid_fragmented But it does not work, throws an error. Apparently I do not know how to apply the movflags argument..... Please help! -- Bo Berglund Developer in Sweden
On 25/09/2025 08:14, Bo Berglund via ffmpeg-user wrote:
On Wed, 24 Sep 2025 20:15:06 +0200, Timo Rothenpieler via ffmpeg-user <ffmpeg-user@ffmpeg.org> wrote:
On 24.09.2025 09:54, Bo Berglund via ffmpeg-user wrote:
On Wed, 11 Jun 2025 20:54:06 +0200, Bo Berglund <bo.berglund-at-gmail.com@ffmpeg.org> wrote:
The hybrid_fragmented flag is used to enable viewers to read an mp4 file while it is being wrtitten according to the documentation here: https://ffmpeg.org/ffmpeg-formats.html
But has it been released yet and in that case from which version is it available? I really need to be able to start viewing mp4 files before they are closed by the writer....
So now 3+ months later and noone seems to know about this?
Will this flag ever be available to the public using Linux?
Or is it available, but only if one uses some special installation of ffmpeg (I am using the standard apt delivered ffmpeg on Ubuntu Server 24.04.3 LTS)
TIA
https://github.com/FFmpeg/FFmpeg/commit/6ec22731ae7694d4db08fff556eea58aa3b9...
So that is a *description* of why you need it (in my case I want to read an unfinished mp4 while it is being downloaded).
Now I have grabbed the very latest ffmpeg nightly from github and symlinked it to be the on-path ffmpeg on one of my Linux machines and it does work for my ordinary scripts to get the mp4 downloads working. So I am on the bleeding edge of ffmpeg on that device.
But I have totally failed in using it with movflags, probably due to the lack of instructions on *how* to activate that flag...
So please give me an example command for ffmpeg download where it is used successfully to allow reading while writing the mp4 file.
I use this ffmpeg command in my download script today where I am forced to save into a ts file because of the inability to read it if it is set to mp4 and I want to modify it to use the new flag to allow me to download into an mp4:
CMD="ffmpeg -hide_banner -loglevel warning ${MODE} -i \"${M3U8URL}\" -r 30 -vf scale=w=-4:h=480 -c:v libx264 -preset fast -crf 26 -x264-params keyint=30:scenecut=0:open-gop=0 -c:a aac -t ${CAPTURETIME} -f mpegts ${TARGETFILETS}"
The variables are: MODE = "-referer \"${VIDEOURL}\"" VIDEOURL = https URL of the webpage hosting the player M3U8URL = the m3u8 of the video stream CAPTURETIME = download time in seconds TARGETFILETS = the ts video file name which I want to be an mp4 instead
I have tried adding this command before the -i argument: movflags=+hybrid_fragmented
But it does not work, throws an error.
Apparently I do not know how to apply the movflags argument.....
Please help!
It's an argument to the output, which actually muxes the mp4 file, not the input. So it goes before the respective output file.
On 2025-09-25 11:44 am, Bo Berglund via ffmpeg-user wrote:
On Wed, 24 Sep 2025 20:15:06 +0200, Timo Rothenpieler via ffmpeg-user <ffmpeg-user@ffmpeg.org> wrote:
On 24.09.2025 09:54, Bo Berglund via ffmpeg-user wrote:
On Wed, 11 Jun 2025 20:54:06 +0200, Bo Berglund <bo.berglund-at-gmail.com@ffmpeg.org> wrote:
The hybrid_fragmented flag is used to enable viewers to read an mp4 file while it is being wrtitten according to the documentation here: https://ffmpeg.org/ffmpeg-formats.html
But has it been released yet and in that case from which version is it available? I really need to be able to start viewing mp4 files before they are closed by the writer.... So now 3+ months later and noone seems to know about this?
Will this flag ever be available to the public using Linux?
Or is it available, but only if one uses some special installation of ffmpeg (I am using the standard apt delivered ffmpeg on Ubuntu Server 24.04.3 LTS)
TIA
https://github.com/FFmpeg/FFmpeg/commit/6ec22731ae7694d4db08fff556eea58aa3b9... So that is a *description* of why you need it (in my case I want to read an unfinished mp4 while it is being downloaded).
Now I have grabbed the very latest ffmpeg nightly from github and symlinked it to be the on-path ffmpeg on one of my Linux machines and it does work for my ordinary scripts to get the mp4 downloads working. So I am on the bleeding edge of ffmpeg on that device.
But I have totally failed in using it with movflags, probably due to the lack of instructions on *how* to activate that flag...
So please give me an example command for ffmpeg download where it is used successfully to allow reading while writing the mp4 file.
I use this ffmpeg command in my download script today where I am forced to save into a ts file because of the inability to read it if it is set to mp4 and I want to modify it to use the new flag to allow me to download into an mp4:
CMD="ffmpeg -hide_banner -loglevel warning ${MODE} -i \"${M3U8URL}\" -r 30 -vf scale=w=-4:h=480 -c:v libx264 -preset fast -crf 26 -x264-params keyint=30:scenecut=0:open-gop=0 -c:a aac -t ${CAPTURETIME} -f mpegts ${TARGETFILETS}"
The variables are: MODE = "-referer \"${VIDEOURL}\"" VIDEOURL = https URL of the webpage hosting the player M3U8URL = the m3u8 of the video stream CAPTURETIME = download time in seconds TARGETFILETS = the ts video file name which I want to be an mp4 instead
I have tried adding this command before the -i argument: movflags=+hybrid_fragmented
movflags is an option for the MP4 muxer (writer). You would replace `-f mpegts` with `-f mp4 -movflags +hybrid_fragmented` Regards, Gyan
On Thu, 25 Sep 2025 08:14:56 +0200, Bo Berglund via ffmpeg-user <ffmpeg-user@ffmpeg.org> wrote:
Now I have grabbed the very latest ffmpeg nightly from github and symlinked it to be the on-path ffmpeg on one of my Linux machines and it does work for my ordinary scripts to get the mp4 downloads working. So I am on the bleeding edge of ffmpeg on that device.
But I have totally failed in using it with movflags, probably due to the lack of instructions on *how* to activate that flag...
FOLLOW-UP --------- Now working fine after modifying the download script where the -movflags command was inserted in the ffmpg call. As was indicated by a couple of posts here the placement on the command line matters, so I moved the setting to the end of the command line right before setting the duration so that it looks like this now towards the end: MOVFLCMD="-movflags +frag_keyframe+empty_moov+default_base_moof -frag_duration 2000000" CMD="ffmpeg ..... -c:a aac ${MOVFLCMD} -t ${CAPTURETIME} ${TARGETFILE}" With this in place it *is* possible to view the mp4 video while it is being downloaded! -- Bo Berglund Developer in Sweden
participants (3)
-
Bo Berglund -
Gyan Doshi -
Timo Rothenpieler