[FFmpeg-user] Audio/Video Synchronization Issue

Ben Murphy Ben.Murphy at migcan.com
Fri Jun 10 11:25:04 CEST 2011


I tried to transcode a video and the audio and video went out of sync. I tried to use the async option but this did not improve the video. In fact the video produced was exactly the same. I think the issue might have something to do with a warning message ffmpeg throws up when it tries to read the file:

Seems stream 1 codec frame rate differs from container frame rate: 5994.00 (5994/1) -> 29.97 (2997/100)

If I read the metadata of the original file I get:

<MovieHeaderBox CreationTime="3387511922" ModificationTime="3387511923" TimeScale="2997" Duration="123900" NextTrackID="3">
<TrackHeaderBox CreationTime="3387511889" ModificationTime="3387511923" TrackID="1" Duration="123900" Volume="1.00">
<EditListEntry Duration="123900" MediaTime="0" MediaRate="1"/>
<MediaHeaderBox CreationTime="3387511922" ModificationTime="3387511922" TimeScale="44100" Duration="1823744" LanguageCode="eng">
<TrackHeaderBox CreationTime="3387511889" ModificationTime="3387511923" TrackID="2" Duration="123900" Width="640.00" Height="480.00">
<EditListEntry Duration="123900" MediaTime="0" MediaRate="1"/>
<MediaHeaderBox CreationTime="3387511922" ModificationTime="3387511923" TimeScale="2997" Duration="123900" LanguageCode="eng">

According to the TrackHeaderBoxes the two tracks have the same duration but according to the mediaheaderbox/movieheaderbox the durations are slightly different.

In the transcoded file the TrackHeaderBoxes of the two tracks have different durations:

<MovieHeaderBox CreationTime="2082844800" ModificationTime="2082844800" TimeScale="1000" Duration="41360" NextTrackID="3">
<TrackHeaderBox CreationTime="2082844800" ModificationTime="2082844800" TrackID="1" Duration="41360" Width="320.00" Height="240.00">
<MediaHeaderBox CreationTime="2082844800" ModificationTime="2082844800" TimeScale="25" Duration="1034" LanguageCode="eng">
<TrackHeaderBox CreationTime="2082844800" ModificationTime="2082844800" TrackID="2" Duration="41152" Volume="1.00">
<MediaHeaderBox CreationTime="2082844800" ModificationTime="2082844800" TimeScale="16000" Duration="658432" LanguageCode="eng">

--

Ben Murphy | Developer | Mobile Interactive Group

M: +447796354848
A: The Tower Building, 7th Floor, 11 York Road, London, SE1 7NX
W: www.migcan.com   Twitter: @migcan


Book your place at the BLN Money in Mobile Forum 2011, 14th June, London, UK to find out how to build profitable mobile strategies


This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Mobile Interactive Group therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the author's employer - Mobile Interactive Group. Mobile Interactive Group does not take any responsibility for the views of the author and reserves the right to monitor, review and retain all emails entering its systems, in accordance with local law.

Registered in England and Wales - Company Number 4672067


More information about the ffmpeg-user mailing list