Opened 9 years ago
Closed 9 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)
Change History (5)
comment:1 by , 9 years ago
Component: | undetermined → avformat |
---|---|
Keywords: | segment added |
by , 9 years ago
Attachment: | ffmpeg-20160309-164520.log added |
---|
output of -report for ffmpeg git head version and -f lavfi -i testsrc
comment:2 by , 9 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
comment:3 by , 9 years ago
Analyzed by developer: | set |
---|---|
Owner: | set to |
Reproduced by developer: | set |
Status: | new → open |
comment:4 by , 9 years ago
Cc: | added |
---|---|
Resolution: | → fixed |
Status: | open → closed |
Fixed in 8ff0f6ae8253d394f096b39d69b66e5247ed1066.
Replying to jeroendnx:
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.