[FFmpeg-trac] #9440(undetermined:new): timeline-free dash muxing not possible with all framerates

FFmpeg trac at avcodec.org
Sun Sep 26 07:45:27 EEST 2021


#9440: timeline-free dash muxing not possible with all framerates
-------------------------------------+-------------------------------------
             Reporter:  Gregory      |                    Owner:  (none)
  Beauregard                         |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:  dash         |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Description changed by Gregory Beauregard:

Old description:

> Summary of the bug: ffmpeg's dash muxer is not compatible with all
> framerates in no-timeline mode
>
> In DASH it is required that the segment duration be specified very
> accurately when `use_template` is enabled and `use_timeline` is disabled
> in order to get the modern templated playlists. In particular,
> submicrosecond errors result in the stream failing to play after a couple
> segments with e.g. dash.js. The DASH spec provides the timebase so that
> in the mpd the segment duration is effectively specified as a rational
> number. This allows the segment duration to be an exact multiple of the
> 1/framerate.
>
> Currently, ffmpeg accepts a "duration" field for the `-seg_duration`
> option of the dash muxer that it converts into an integer number of
> microseconds and a timebase of 1000000 meaning that the ffmpeg DASH muxer
> in modes without a timeline is only compatible with segment durations
> that can be represented exactly as an integer number of microseconds.
>
> Not all slightly uncommon framerates in the wild have '''any'''
> reasonable segment duration that can be represented exactly with an
> integer number of microseconds, meaning that ffmpeg's dash muxer does not
> support these framerates in no-timeline mode.
>
> To demonstrate this, consider the slightly uncommon framerate 23.976
> (2997/125). In order to have a truncating float representation, the
> segment duration (=GOP_SIZE/framerate) must, at minimum, have a reduced
> fraction representation with only factors of 2 and 5 in the denominator.
> Because the GOP_SIZE is an integer and 2997 has no factors of 2 or 5, the
> GOP_SIZE must at minimum have 2997 as a factor in order to be compatible
> with ffmpeg's DASH muxer (the GOP size must have factors that cancel out
> everything that's not a factor of 2 or 5). If this minimum value is
> chosen, the segment duration would be 2997/23.976=125 seconds. So the
> ffmpeg DASH muxer is unusable in no-timeline mode with framerates of
> 23.976 and segment lengths under 125 seconds (not generally usable for
> streaming). Note in addition to this, to be compatible with the DASH
> muxer the reduced fraction representation of the segment length must have
> a denominator <=`10^6` due to the microseconds used, but that's not
> relevant to see the failure here.
>

> How to reproduce:
> Generate a DASH playlist with `use_template` enabled and `use_timeline`
> disabled using a file with a framerate of 23.976 (2997/125). dash.js will
> not be able to play more than a couple segments without going out of sync
> and failing to load the stream.

New description:

 Summary of the bug: ffmpeg's dash muxer is not compatible with all
 framerates in no-timeline mode

 In DASH it is required that the segment duration be specified very
 accurately when `use_template` is enabled and `use_timeline` is disabled
 in order to get the modern templated playlists. In particular,
 submicrosecond errors result in the stream failing to play after a couple
 segments with e.g. dash.js. The DASH spec provides the timebase so that in
 the mpd the segment duration is effectively specified as a rational
 number. This allows the segment duration to be an exact multiple of the
 1/framerate.

 Currently, ffmpeg accepts a "duration" field for the `-seg_duration`
 option of the dash muxer that it converts into an integer number of
 microseconds and a timebase of 1000000 meaning that the ffmpeg DASH muxer
 in modes without a timeline is only compatible with segment durations that
 can be represented exactly as an integer number of microseconds.

 Not all slightly uncommon framerates in the wild have '''any''' reasonable
 segment duration that can be represented exactly with an integer number of
 microseconds, meaning that ffmpeg's dash muxer does not support these
 framerates in no-timeline mode.

 To demonstrate this, consider the slightly uncommon framerate 23.976
 (2997/125). In order to have a truncating float representation, the
 segment duration (=GOP_SIZE/framerate) must, at minimum, have a reduced
 fraction representation with only factors of 2 and 5 in the denominator.
 Because the GOP_SIZE is an integer and 2997 has no factors of 2 or 5, the
 GOP_SIZE must at minimum have 2997 as a factor in order to be compatible
 with ffmpeg's DASH muxer (the GOP size must have factors that cancel out
 everything that's not a factor of 2 or 5). If this minimum value is
 chosen, the segment duration would be 2997/23.976=125 seconds. So the
 ffmpeg DASH muxer is unusable in no-timeline mode with framerates of
 23.976 and segment lengths under 125 seconds (a length too long for
 streaming). Note in addition to this, to be compatible with the DASH muxer
 the reduced fraction representation of the segment length must have a
 denominator <=`10^6` due to the microseconds used, but that's not relevant
 to see the failure here.


 How to reproduce:
 Generate a DASH playlist with `use_template` enabled and `use_timeline`
 disabled using a file with a framerate of 23.976 (2997/125). dash.js will
 not be able to play more than a couple segments without going out of sync
 and failing to load the stream.

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


More information about the FFmpeg-trac mailing list