[FFmpeg-trac] #8380(avformat:new): EXT-X-TARGETDURATION can't be 0

FFmpeg trac at avcodec.org
Fri Nov 15 11:08:31 EET 2019


#8380: EXT-X-TARGETDURATION can't be 0
----------------------------------+--------------------------------------
             Reporter:  simonb    |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avformat  |                  Version:  git-master
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+--------------------------------------
 Summary of the bug:
 If the hls_time < 0.5 then EXT-X-TARGETDURATION is 0. This results in an
 invalid condition that prevents HLS players from working.

 From RFC 8216:

 "The EXT-X-TARGETDURATION tag specifies the maximum Media Segment
 duration. The EXTINF duration of each Media Segment in the Playlistfile,
 when rounded to the nearest integer, MUST be less than or equal to the
 target duration; longer segments can trigger playback stalls or other
 errors."
 https://tools.ietf.org/html/rfc8216#page-22

 When EXT-X-TARGETDURATION is 0 then the condition, "MUST be less than or
 equal to the target duration", is never met.

 In these conditions the capital word "MUST" implies that the requirement
 to "be less than or equal to the target duration" is a higher priority
 than "rounded to the nearest integer" and therefore represents a special
 case.

 Bumping any EXT-X-TARGETDURATION:0 to EXT-X-TARGETDURATION:1 allows HLS
 players such as hls.js and Android's <audio> tag to play OK, otherwise
 they don't.


 How to reproduce:
 {{{
 ffmpeg -re -f lavfi -i "sine=frequency=1000" -c:a aac -ar 44100 -ac 1 -b:a
 64k -hls_time 0.2 -hls_list_size 5 -hls_flags delete_segments out.m3u8

 ffmpeg-static -version
 ffmpeg version N-95730-ga7245adee3 Copyright (c) 2000-2019 the FFmpeg
 developers
 built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
 configuration: --prefix=/home/simonb/Documents/Source/ffmpeg/static_build
 --logfile=config.log --extra-
 cflags=-I/home/simonb/Documents/Source/ffmpeg/static_build/include
 --extra-ldflags=-L/home/simonb/Documents/Source/ffmpeg/static_build/lib
 --extra-ldexeflags=-static --pkg-config-flags=--static --disable-shared
 --enable-static --disable-all --disable-dxva2 --disable-vaapi --disable-
 vdpau --enable-network --enable-ffmpeg --enable-pthreads --enable-runtime-
 cpudetect --enable-libopus --enable-libmp3lame --enable-alsa --enable-
 indev='alsa,lavfi' --enable-parser='opus,mpegaudio,aac,aac_latm' --enable-
 muxer='hls,opus,mp3,segment' --enable-demuxer='ogg,mp3,aac,aac_latm,pcm_*'
 --enable-encoder='libopus,libmp3lame,aac,libfdk_aac' --enable-
 filter='aresample,sine' --enable-
 decoder='libopus,opus,mp3,mp3float,libfdk_aac,pcm_*' --enable-
 protocol='file,unix,hls,tcp,udp,rtp,http,pipe' --enable-avcodec --enable-
 avdevice --enable-avfilter --enable-avformat --enable-swresample --enable-
 libfdk-aac

 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8380>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list