[FFmpeg-trac] #6915(avformat:open): DASH audio segments duration doesn't match exactly with video segments duration.

FFmpeg trac at avcodec.org
Fri Dec 22 01:50:35 EET 2017


#6915: DASH audio segments duration doesn't match exactly with video segments
duration.
------------------------------------+-------------------------------------
             Reporter:  beloko      |                    Owner:  stevenliu
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+-------------------------------------

Comment (by stevenliu):

 Replying to [comment:38 j_karthic]:
 > Replying to [comment:37 beloko]:
 > > Not sure Roger understood the question really or he forgot "Each Media
 Playlist in each Variant Stream MUST have the same target duration.".
 That's why the Apple mediastreamvalidator complains ;)
 >
 > I think, Roger was clear. Actually your original statement was
 >
 > {{{
 > To be compliant with the Apple mediastreamvalidator tool, video segments
 and
 > audio segments should have the same duration. And the
 #EXT-X-TARGETDURATION tag
 > should have the value 4 instead of 5
 > }}}
 >
 > That is not completely true. video and audio segments need not have the
 same duration. They just need to have the same "target" duration. The word
 "target" was missing in your statement :)
 > Ofcourse you were right about the second part that #EXT-X-TARGETDURATION
 tag should have the value 4 instead of 5
 >

 Yes, you are right, i have double check from Pantos:


 {{{
 2017-12-22 7:22 GMT+08:00 Roger Pantos <rpantos at apple.com>:
 > 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.

 Thanks



 Steven
 >
 > Roger
 > Sent from my iPhone.
 >
 >> On Dec 21, 2017, at 2:53 PM, Steven Liu <lingjiujianke at gmail.com>
 wrote:
 >>
 >> 2017-12-22 0:51 GMT+08:00 Roger Pantos <rpantos at apple.com>:
 >>> Hello Steven,
 >>>
 >>>> On Dec 20, 2017, at 11:19 PM, Steven Liu <lingjiujianke at gmail.com>
 wrote:
 >>>>
 >>>> Hi HLS Team,
 >>>>
 >>>>     This is a ffmpeg developer for hls, there have a problem about
 >>>> user muxing hls,
 >>>>
 >>>>     I saw the specification said:
 >>>>
 >>>> 4.3.3.1.  EXT-X-TARGETDURATION
 >>>>
 >>>>  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>
 >>>>
 >>>>  where s is a decimal-integer indicating the target duration in
 >>>>  seconds.  The EXT-X-TARGETDURATION tag is REQUIRED.
 >>>>
 >>>>
 >>>> i cannot sure if i misunderstand or that is a mistake, user use
 >>>> mediastreamvalidator to check the hls file, When EXT-X-TARGETDURATION
 >>>> value more than EXTINF, the mediastreamvalidator report warnng, the
 >>>> detail infomation is linkto:
 >>>> https://trac.ffmpeg.org/ticket/6915#comment:6
 >>>
 >>> I took a look at that link. There’s a lot there, so I’m not sure if
 I’m focused on the right question.
 >>>
 >>> But it is perfectly legal to have EXTINF durations that are less than
 EXT-X-TARGETDURATION. Much less, in fact.
 >>>
 >>> Moreover, regarding this comment:
 >>>
 >>>> To be compliant with the Apple mediastreamvalidator tool, video
 segments and audio segments should have the same duration. And the
 #EXT-X-TARGETDURATION tag should have the value 4 instead of 5.
 >>>
 >>> I don’t think that’s true. The mediastreamvalidator does not (or
 should not, anyway) require that video and audio segments have the same
 duration, only that their EXT-X-TARGETDURATION values match.
 >>>
 >>> To be clear, the EXT-X-TARGETDURATION is the max (roughly) of EXTINF
 durations. That’s all.
 >>
 >> Hi Roger Pantos,
 >>
 >>      have some more question i need more clearly.
 >>
 >>      When the longest segment's #EXTINF 1.020000
 >>      EXT-X-TARGETDURATION should be 1 or 2?
 >>
 >>      The specification said:
 >>       "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. "
 >>
 >>       1. read this logic, some people understand to :
 >>       if (round(EXTINF_value) <= EXT-X-TARGETDURATION_value) {
 >>           EXT-X-TARGETDURATION_value = lrint(EXTINF_value);
 >>       } else {
 >>            longer segments can trigger playback stalls or other errors
 >>       }
 >>
 >> the result:
 >>      The EXT-X-TARGETDURATION_value is set to 1 when the  longest
 >> segment's #EXTINF is 1.020000,
 >>      The EXT-X-TARGETDURATION_value is set to 2 when the  longest
 >> segment's #EXTINF is 1.620000,
 >>
 >>
 >>       2. but now i implement it like this:
 >>
 >>         // just get the EXTINF_value Fraction, if the Fraction large
 >> than 0.001(this maybe 1000fps), +1, else = EXTINF_value, this can be
 >> used in audio.
 >>         EXT-X-TARGETDURATION_value = (int)((EXTINF_value - (int)
 >> EXTINF_value) >= 0.001) ? (int)(EXTINF_value + 1) : (int)
 >> EXTINF_value;
 >>       }
 >>
 >> the result:
 >>      The EXT-X-TARGETDURATION_value is set to 2 when the  longest
 >> segment's #EXTINF is 1.020000,
 >>      The EXT-X-TARGETDURATION_value is set to 2 when the  longest
 >> segment's #EXTINF is 1.620000,
 >>
 >>
 >>      this is our controversy point of the specification:
 >> https://tools.ietf.org/html/rfc8216#page-22   4.3.3.1.
 >> EXT-X-TARGETDURATION
 >>
 >> I cannot sure which one is better or which one is recommend?
 >>
 >>
 >>
 >> Thanks
 >>
 >>
 >> Steven Liu
 >>
 >>
 >>>
 >>>
 >>> regards,
 >>>
 >>> Roger Pantos
 >>> Apple Inc.
 >>>
 >>>>
 >>>>
 >>>> Thanks
 >>>>
 >>>>
 >>>> Steven Liu
 >>>
 }}}

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


More information about the FFmpeg-trac mailing list