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

FFmpeg trac at avcodec.org
Tue Dec 19 22:24:46 EET 2017


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

Comment (by beloko):

 I encoded Tears of Steel as a full movie now. Its total duration is near
 12 minutes and exactly 184 segments. This video lets detect more easily
 when video and audio tracks are desynchronized than Big Buck Bunny.

 So I can play the full movie produced with FFMPEG and use the seek bar
 duration without desynchronization into Windows Edge and Safari web
 browsers.

 After manually replacing the #EXT-X-TARGETDURATION 5 value by the 4 value
 in the audio playlist media_1.m3u8, the video always playback properly in
 web browsers.

 And it fixes issue with the mediastreamvalidator tools.

 Here is the full report :


 {{{
 Belokos-Mac:~ beloko$ mediastreamvalidator
 http://192.168.1.3/fmp4_x264/master.m3u8
 mediastreamvalidator: Version 1.2(170822)

 [/fmp4_x264/master.m3u8] Started root playlist download
 [media_0.m3u8] Started media playlist download
 [media_1.m3u8] Started media playlist download
 [media_1.m3u8] parsed media segment count: 75, duration: 303.926
 [media_1.m3u8] parsed media segment count: 150, duration: 603.928
 [media_1.m3u8] All media files delivered and have end tag, stopping
 [media_0.m3u8] parsed media segment count: 74, duration: 300.000
 [media_0.m3u8] parsed media segment count: 149, duration: 600.000
 [media_0.m3u8] All media files delivered and have end tag, stopping

 --------------------------------------------------------------------------------
 media_0.m3u8
 --------------------------------------------------------------------------------
 Processed 184 out of 184 segments
 Average segment duration: 3.989130
 Total segment bitrates (all discontinuities): average: 16353.10 kb/s, max:
 46174.48 kb/s
 Playlist max bitrate: 46312.470000 kb/s
 Audio Group ID: media_1


 Discontinuity: sequence: 0, parsed segment count: 184 of 184, duration:
 734.000 sec, average: 16353.10 kb/s, max: 46174.48 kb/s
 Track ID: 1
 Video Codec: avc1
 Video profile: High
 Video level: 5.1
 Video resolution: 3840x1714
 Video average IDR interval: 4.000000, Standard deviation: 0.000000
 Video frame rate: 25.000

 --------------------------------------------------------------------------------
 media_1.m3u8
 --------------------------------------------------------------------------------
 Processed 184 out of 184 segments
 Average segment duration: 3.988784
 Total segment bitrates (all discontinuities): average: 131.87 kb/s, max:
 137.99 kb/s
 Rendition group ID: media_1


 Discontinuity: sequence: 0, parsed segment count: 184 of 184, duration:
 733.936 sec, average: 131.87 kb/s, max: 137.99 kb/s
 Track ID: 1
 Audio Codec: AAC-LC
 Audio sample rate: 44100 Hz
 Audio channels: 2
 Audio channel layout: Stereo (L R)
 }}}

 Mediastreamvalidator doesn't complain anymore. But it doesn't respect the
 Roger Pantos RFC8216.

 ----

 Then I decided to round all #EXTINF: values at 4 seconds as expected in
 the audio playlist media_1.m3u8. To get the same duration for all
 segments. And to accord their duration with all segments from he video
 playlist media_0.m3u8.

 Video and audio playback synchronization is properly rendering into Safari
 and Windows Edge web browsers.

 And the mediastreamvalidator doesn't complain. It find the same average
 segment duration of 3.989130 for video and audio playlist. That's perfect.

 Here is the full report :

 {{{
 Belokos-Mac:~ beloko$ mediastreamvalidator
 http://192.168.1.3/fmp4_x264/master.m3u8
 mediastreamvalidator: Version 1.2(170822)

 [/fmp4_x264/master.m3u8] Started root playlist download
 [media_0.m3u8] Started media playlist download
 [media_1.m3u8] Started media playlist download
 [media_1.m3u8] parsed media segment count: 74, duration: 300.000
 [media_1.m3u8] parsed media segment count: 149, duration: 600.000
 [media_1.m3u8] All media files delivered and have end tag, stopping
 [media_0.m3u8] parsed media segment count: 74, duration: 300.000
 [media_0.m3u8] parsed media segment count: 149, duration: 600.000
 [media_0.m3u8] All media files delivered and have end tag, stopping

 --------------------------------------------------------------------------------
 media_0.m3u8
 --------------------------------------------------------------------------------
 Processed 184 out of 184 segments
 Average segment duration: 3.989130
 Total segment bitrates (all discontinuities): average: 16353.10 kb/s, max:
 46174.48 kb/s
 Playlist max bitrate: 46312.470000 kb/s
 Audio Group ID: media_1


 Discontinuity: sequence: 0, parsed segment count: 184 of 184, duration:
 734.000 sec, average: 16353.10 kb/s, max: 46174.48 kb/s
 Track ID: 1
 Video Codec: avc1
 Video profile: High
 Video level: 5.1
 Video resolution: 3840x1714
 Video average IDR interval: 4.000000, Standard deviation: 0.000000
 Video frame rate: 25.000

 --------------------------------------------------------------------------------
 media_1.m3u8
 --------------------------------------------------------------------------------
 Processed 184 out of 184 segments
 Average segment duration: 3.989130
 Total segment bitrates (all discontinuities): average: 131.86 kb/s, max:
 137.78 kb/s
 Rendition group ID: media_1


 Discontinuity: sequence: 0, parsed segment count: 184 of 184, duration:
 734.000 sec, average: 131.86 kb/s, max: 137.78 kb/s
 Track ID: 1
 Audio Codec: AAC-LC
 Audio sample rate: 44100 Hz
 Audio channels: 2
 Audio channel layout: Stereo (L R)

 }}}

 ----

 This tests mean, just fix the audio playlist is enough to be compliant
 with the Apple mediastreamvalidator tool and support the RFC8216. No need
 to cut the audio streams at exactly 4 seconds like we were supposing.

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


More information about the FFmpeg-trac mailing list