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

FFmpeg trac at avcodec.org
Thu Dec 21 19:15:46 EET 2017

#6915: DASH audio segments duration doesn't match exactly with video segments
             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 beloko):

 Each Media Playlist in each Variant Stream MUST have the same
 target duration.  The only exceptions are SUBTITLES Renditions and
 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY
 have different target durations if they have an EXT-X-PLAYLIST-

 Alternate audio tracks are define as #EXT-X-MEDIA:TYPE=AUDIO in the master
 playlist. So in theory audio segments "MUST" be exactly 4 seconds long.
 But as you say in practice an audio stream can't be cut at exactly 4
 seconds long.

 That's why I think rounding the #EXTINF value could be the best outcome to
 fix this issue and produce HLS streams with alternate audio tracks
 validated by the Apple mediastreamvalidator tool. And compliant with the
 RFC 8216.

 When the segmenter generate the .m3u8 playlist it knows the expected
 segment duration via the -min_seg_duration 4000000 parameter. And it knows
 the real segment duration since it can currently write the exact value in
 the playlist.

 IF( INT($expected_duration - $real_duration) <= $tolerated_milliseconds )
 THEN $real_duration = ROUND($real_duration);
 WRITE "#EXTINF:" + $real_duration;

 But if this fix can create compatibility issues with some alternative HLS
 players; I can also accept the Steven's process : forcing the
 #EXT-X-TARGETDURATION in all alternate audio playlists to the same value
 as the  #EXT-X-TARGETDURATION setted in the main video playlist.

 In any case the fix isn't hurry. This issue could be delayed the time
 required to consider others ways.

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

More information about the FFmpeg-trac mailing list