Opened 8 years ago

Closed 8 years ago

#5318 closed defect (fixed)

ffmpeg segment format options are only applied to first segment

Reported by: Jeroen Coekaerts Owned by: Marton Balint
Priority: normal Component: avformat
Version: unspecified Keywords: segment
Cc: cus@passwd.hu Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Summary of the bug:

In the second example at
https://www.ffmpeg.org/ffmpeg-formats.html#Examples-6
there is segment output format option set, but this option is only applied to the first segment.

Tested ffmpeg 2.8 and 3.0

How to reproduce:

make segments:
ffmpeg -i /tmp/file.mp4 -f segment -segment_time 2 -segment_format_options movflags=faststart bout%03d.mp4

first segment:
qt-faststart bout000.mp4 bout000.mp4_2
ftyp 0 28
moov 28 1073
free 1101 8
mdat 1109 166746
last atom in file was not a moov atom
-> was already faststart, good

second segment:
qt-faststart bout001.mp4 bout000.mp4_2
ftyp 0 28
free 28 8
mdat 36 97857
moov 97893 1073
patching stco atom...
writing ftyp atom...
writing moov atom...
copying rest of file...
-> was not faststart yet, bad

Here is a log of ffmpeg only applying the option once:

ffmpeg -loglevel 100 -i big_buck_bunny_480p_surround-fix.avi -an -f segment -segment_time 2 -segment_format_options movflags=faststart out%03d.mp4 2>&1 | grep -e 'count' -e 'moov'

gives:
[mp4 @ 0x32e7200] Starting second pass: moving the moov atom to the beginning of the file
[segment @ 0x2502c00] segment:'out000.mp4' count:0 ended
[segment @ 0x2502c00] segment:'out001.mp4' count:1 ended
[segment @ 0x2502c00] segment:'out002.mp4' count:2 ended
[segment @ 0x2502c00] segment:'out003.mp4' count:3 ended
[segment @ 0x2502c00] segment:'out004.mp4' count:4 ended
[segment @ 0x2502c00] segment:'out005.mp4' count:5 ended
[segment @ 0x2502c00] segment:'out006.mp4' count:6 ended
[segment @ 0x2502c00] segment:'out007.mp4' count:7 ended

Attachments (1)

ffmpeg-20160309-164520.log (1.3 MB ) - added by Jeroen Coekaerts 8 years ago.
output of -report for ffmpeg git head version and -f lavfi -i testsrc

Download all attachments as: .zip

Change History (5)

in reply to:  description comment:1 by Carl Eugen Hoyos, 8 years ago

Component: undeterminedavformat
Keywords: segment added

Replying to jeroendnx:

Tested ffmpeg 2.8 and 3.0

Please test current FFmpeg git head and please provide your simplified command line (-f lavfi -i testsrc) together with the complete, uncut console output to make this a valid ticket.
May be a duplicate of #2547.

by Jeroen Coekaerts, 8 years ago

Attachment: ffmpeg-20160309-164520.log added

output of -report for ffmpeg git head version and -f lavfi -i testsrc

comment:2 by Jeroen Coekaerts, 8 years ago

OK, tested it with git version and -f lavfi -i testsrc, see attachment

It has the same problem: only see "moving the moov atom to the beginning of the file" once in the output and qt-faststart out000.mp4 out.mp4 says it was already faststart and qt-faststart out001.mp4 out.mp4 gave no error

Last edited 8 years ago by Jeroen Coekaerts (previous) (diff)

comment:3 by Marton Balint, 8 years ago

Analyzed by developer: set
Owner: set to Marton Balint
Reproduced by developer: set
Status: newopen

comment:4 by Marton Balint, 8 years ago

Cc: cus@passwd.hu added
Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.