Opened 16 months ago

#10112 new defect

HLS Demuxer - Live Playlists needlessly re-download initialization segment

Reported by: John Regan Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: HLS hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Hi there - I noticed when playing HLS playlists, ffplay (and apps using libavformat) will re-download the initialization segment for each new media segment added to the list. This causes some warnings to appear, and essentially doubles the number of HTTP requests made during a live playlist.

The warning messages are for duplicated MOOV atoms:

[http @ 0x7fc4e8008a40] Opening 'http://127.0.0.1:8080/init.mp4' for reading
[hls @ 0x7fc4e8000c80] Opening 'http://127.0.0.1:8080/stream4.m4s' for reading
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc4e80076c0] Found duplicated MOOV Atom. Skipped it
[http @ 0x7fc4e8101f40] Opening 'http://127.0.0.1:8080/stream.m3u8' for reading
[hls @ 0x7fc4e8000c80] Skip ('#EXT-X-VERSION:7')
[http @ 0x7fc4e8008a40] Opening 'http://127.0.0.1:8080/init.mp4' for reading
[hls @ 0x7fc4e8000c80] Opening 'http://127.0.0.1:8080/stream5.m4s' for reading
[http @ 0x7fc4e8025480] Opening 'http://127.0.0.1:8080/stream6.m4s' for reading
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc4e80076c0] Found duplicated MOOV Atom. Skipped it

How to reproduce:

% ffmpeg -i http://something-live.example -c:a aac -vn -f hls -hls_segment_type fmp4 /path/to/folder/stream.m3u8
# in another terminal serve /path/to/folder
% python -m http.server --directory /path/to/folder 8080
# play the stream
% ffplay http://127.0.0.1:8080/stream.m3u8

ffmpeg info from my machine:

ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
libavutil      57. 28.100 / 57. 28.100
libavcodec     59. 37.100 / 59. 37.100
libavformat    59. 27.100 / 59. 27.100
libavdevice    59.  7.100 / 59.  7.100
libavfilter     8. 44.100 /  8. 44.100
libswscale      6.  7.100 /  6.  7.100
libswresample   4.  7.100 /  4.  7.100
libpostproc    56.  6.100 / 56.  6.100

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (0)

Note: See TracTickets for help on using tickets.