[FFmpeg-trac] #10496(undetermined:new): Wrong first audio segment duration when generating dash segments and playlist.mpd
FFmpeg
trac at avcodec.org
Mon Jul 31 13:23:49 EEST 2023
#10496: Wrong first audio segment duration when generating dash segments and
playlist.mpd
-------------------------------------+-------------------------------------
Reporter: Mirko Gibin | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: DASH | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
I have a 60fps video with a 48000hz audio track and I want to generate
dash segments and a playlist MPD from it. Segments need to be of the same
length (with exclusion of the last one)
Looking inside the generated playlist.mpd I can see that the first audio
segments is shorter than the others. If I reproduce the playlist starting
from segment 1 everything works fine. If I reproduce the playlist starting
from another segment (e.g. segment 5) audio and video are not in sync.
How to reproduce:
The command to generate dash segments is the following one.
{{{
ffmpeg -i input.mp4 -c:v libx264 -c:a aac -dash_segment_type mp4 -f dash
-g 96 -movflags frag_keyframe+empty_moov+default_base_moof+faststart
-sc_threshold 0 -seg_duration 1.6 -use_template 1 -use_timeline 1
playlist.mpd
}}}
The generated audio adaptation set is composed as follows:
{{{
<AdaptationSet id="1" contentType="audio" startWithSAP="1"
segmentAlignment="true" bitstreamSwitching="true" lang="und">
<Representation id="1" mimeType="audio/mp4"
codecs="mp4a.40.2" bandwidth="341000" audioSamplingRate="48000">
<AudioChannelConfiguration
schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
value="6" />
<SegmentTemplate timescale="48000"
initialization="init-stream$RepresentationID$.m4s" media="chunk-
stream$RepresentationID$-$Number%05d$.m4s" startNumber="5">
<SegmentTimeline>
<S t="0" d="75776" />
<S d="76800" r="35" />
<S d="39936" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
}}}
If you set the startNumber=1 in the playlist on both video and audio
adaptation sets everything works fine. If you set the startNumber=5 in the
playlist on both video and audio adaptation sets you can hear and see that
audio and video are not synchronized.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10496>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list