#9193 closed defect (fixed)
Invalid initialization segment with HLS FMP4 encoder
Reported by: | Jason | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | hls regression |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description (last modified by )
VERSION: ffmpeg version 4.4 + head branch| Windows & Linux
The HLS encoder (used with fmp4 segmenting) began generating invalid initialization segments consisting of 5 boxes (ftyp, moov, sidx, moof, & mdat) with the latest release -- and an invalid first data segment consisting of a single styp box with no data. Subsequent segments after the first are OK.
It appears if the initialization segment has taken over the data from the first segment.
Version 4.3 and the dash encoder generate an initialization segment with a single ftyp and moov box, as expected.
Here is sample command and file that exhibits the behavior:
./ffmpeg.exe -i "https://carbon-media.accelerator.net/00000000001/4ajEIDZneABc1Uin8Pw163" -y -report -an -codec:v libx264 -b:v 1000k -s 960x540 -hls_time 4 -hls_segment_type fmp4 -hls_playlist_type event -f hls "output.m3u8"
The complete log output / report is attached.
Attachments (2)
Change History (11)
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 4 years ago
Summary: | Invalid initialization segment with HLS FMP4 Segementation → Invalid initialization segment with HLS FMP4 encoder |
---|
comment:3 by , 4 years ago
Description: | modified (diff) |
---|
comment:4 by , 4 years ago
Keywords: | hls added |
---|---|
Priority: | important → normal |
by , 4 years ago
Attachment: | ffmpeg-20210419-100318.log added |
---|
comment:5 by , 4 years ago
Description: | modified (diff) |
---|
comment:6 by , 4 years ago
Hi Carl. I've attached the full uncut log (run against a build cut from yesterdays HEAD) and included a source in the command line used to recreate the behavior.
by , 4 years ago
Attachment: | Command Output Files.png added |
---|
comment:7 by , 4 years ago
Reverting https://github.com/FFmpeg/FFmpeg/commit/b5ca8f2c66954614d81579082025f580efc0cffc (coming from https://trac.ffmpeg.org/ticket/8636) fixes this issue for me. Possibly fixes the other issue (https://trac.ffmpeg.org/ticket/9205) too.
You can try this with a simple
git revert b5ca8f2c66954614d81579082025f580efc0cffc
on the latest master branch.
I've come across this when trying to play an HLS-fmp4 stream generated with the latest FFmpeg using ffplay:
ffplay version 4.4 Copyright (c) 2003-2021 the FFmpeg developers built with Apple clang version 12.0.0 (clang-1200.0.32.29) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 [hls @ 0x7fc42d05f600] Skip ('#EXT-X-VERSION:7') [hls @ 0x7fc42d05f600] Opening '7858485ed5a3afab23523f6de39a215e-1.mp4' for reading [hls @ 0x7fc42d05f600] Opening '7858485ed5a3afab23523f6de39a215e0.mp4' for reading [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc42d80c200] invalid size 0 in stsd [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc42d80c200] error reading header main.m3u8: Invalid data found when processing input
comment:8 by , 4 years ago
Component: | undetermined → avformat |
---|---|
Keywords: | regression added |
Priority: | normal → important |
comment:9 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed by Steven in 59032494e81a1a65c0b960aaae7ec4c2cc9db35a
Please test current FFmpeg git head and provide the command line you tested together with the complete, uncut console output and an input file to make this a valid ticket.