Opened 6 years ago
Closed 6 years ago
#7166 closed defect (fixed)
HLS format with fmp4 creates empty init.mp4 file when there is a single m4s output segment
Reported by: | Jordan | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | hls |
Cc: | james@moxion.io | Blocked By: | |
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Summary of the bug:
When using the hls format and fmp4 segment type, ffmpeg creates broken output segments if the input file has a short duration.
Specifically whenever there is a single m4s output segment. This seems to happen anytime the input file duration is less than hls_time, or if the input file only has a single keyframe.
With the repro command below, four files are produced.
- init.mp4
- segment0.m4s
- segment.m3u8 (contents appear correct)
- ffmpeg log (from -report flag)
The init.mp4 file is empty with 0 bytes. I inspected the segment0.m4s with mp4dump, and it contains the data that should be in init.mp4, (styp, ftyp & moov).
I expected init.mp4 to contain the styp, ftyp and moov atoms, and segment0.m4s should contain a moof and mdat.
How to reproduce:
% ffmpeg -i h264_5s.mp4 -f hls -hls_segment_type fmp4 -hls_time 10 -report segment.m3u8 ffmpeg version
Reproduced with latest build from today (2018-04-26), and 4.0 release.
I'll upload the report log and sample mp4
Attachments (3)
Change History (7)
by , 6 years ago
Attachment: | h264_5s.mp4 added |
---|
by , 6 years ago
Attachment: | mp4dump-segment0.txt added |
---|
mp4dump of segment0.m4s. seems to match expected contents of init.mp4
comment:2 by , 6 years ago
cehoyos, I am able to reproduce with testsrc2. Thanks for your suggestion, I wasn't aware of that feature.
So, here's a cmd to repro the bug with testsrc2 (2 second video)
ffmpeg -f lavfi -i testsrc2=d=2 -f hls -hls_segment_type fmp4 -hls_time 10 -report segment.m3u8
Sanity check, output works fine with a 20 second test
ffmpeg -f lavfi -i testsrc2=d=20 -f hls -hls_segment_type fmp4 -hls_time 10 -report segment.m3u8
comment:3 by , 6 years ago
Cc: | added |
---|
Possibly related commit id: 8318f60845bbbc4d33a39eee45e4daff0e5dacfb
Which was a fix for ticket #6888
comment:4 by , 6 years ago
Component: | undetermined → avformat |
---|---|
Reproduced by developer: | set |
Resolution: | → fixed |
Status: | new → closed |
Version: | unspecified → git-master |
short video to reproduce bug (about 5 seconds, h264)