[FFmpeg-trac] #6533(avformat:reopened): Invalid EXT-X-TARGETDURATION in HLS

FFmpeg trac at avcodec.org
Sun Aug 18 03:42:20 EEST 2019


#6533: Invalid EXT-X-TARGETDURATION in HLS
-------------------------------------+------------------------------------
             Reporter:  tonn81       |                    Owner:
                 Type:  defect       |                   Status:  reopened
             Priority:  normal       |                Component:  avformat
              Version:  unspecified  |               Resolution:
             Keywords:  hls          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+------------------------------------

Comment (by stevenliu):

 Replying to [comment:25 thecodeassassin]:
 >
 > According to the spec:
 >    The EXT-X-TARGETDURATION tag specifies the maximum Media Segment
 >    duration.  The EXTINF duration of each Media Segment in the Playlist
 >    file, 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.  It applies to the entire Playlist file.  Its format
 >    is:
 >
 >    #EXT-X-TARGETDURATION:<s>
 >
 > https://tools.ietf.org/html/rfc8216#section-4.3.3.1
 >
 >
 > The way that the rounding is being done is invalid:
 >
 https://github.com/FFmpeg/FFmpeg/blob/23678462c0a316772d112ca363a4ffdf7d4b4236/libavformat/hlsenc.c#L1482
 >
 > It results in invalid playlists:
 >
 > #EXTM3U
 > #EXT-X-VERSION:3
 > #EXT-X-TARGETDURATION:8
 > #EXT-X-MEDIA-SEQUENCE:0
 > #EXTINF:8.250000,
 > 0000.ts
 > #EXTINF:7.227000,
 > 0001.ts
 > #EXT-X-ENDLIST
 >
 >
 > This playlist (while playable in ffplay, but not in most browser-based
 players) is invalid according to the specification.

 reference this link:
 https://trac.ffmpeg.org/ticket/6915


 And i have checked this problem from Pantos:



 {{{
 Roger Pantos  于2017年12月22日周五 上午11:11写道:



  > On Dec 21, 2017, at 3:36 PM, Steven Liu  wrote:
  >
  > 2017-12-22 7:22 GMT+08:00 Roger Pantos :
  >> If the longest EXTINF is 1.02 then you should set EXT-X-TARGETDURATION
 to 1.
  > Ok, i will modify that use lrint(EXTINF) to set the
 EXT-X-TARGETDURATION.

  I think you probably want something like this:

   EXT-X-TARGETDURATION_value = MAX(EXT-X-TARGETDURATION_value,
 lrint(EXTINF_value));


  Roger.
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6533#comment:27>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list