Opened 9 months ago

Last modified 9 months ago

#10496 new defect

Wrong first audio segment duration when generating dash segments and playlist.mpd

Reported by: Mirko Gibin Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords: DASH
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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.

Attachments (1)

log-and-playlist.zip (340.9 KB ) - added by Mirko Gibin 9 months ago.
ffmpeg logs and generated playlist

Download all attachments as: .zip

Change History (2)

by Mirko Gibin, 9 months ago

Attachment: log-and-playlist.zip added

ffmpeg logs and generated playlist

comment:1 by Mirko Gibin, 9 months ago

Component: undeterminedffmpeg
Note: See TracTickets for help on using tickets.