Video out of sync with audio

Hi all,
I noticed, playing mp4 videos in my iTunes library, I have about 150-200ms of video delay. I mean, the video frame comes 150-200ms after the sound frame.

Have checked playing same content with other players: Windows Media Player, Media Player Classic and VLC will play fine the video. QuickTime player standalone, will have same delay.

I can notice it just on videos where we have fast actions and rapid scene changes. Hardly can be noticed when, as example, people were just talking in same scene.

I guess I have to deal with quicktime configuration somewhere, to have it avoid the delay.

About my hw and sw config, I was running videos on Win7 64bit on the bootcamp partition of my home iMac 21" (Aug 2010).

Info about the clip where I can clearly notice the delay:
Video
ID : 201
Format : MPEG-4 Visual
Format profile : Simple@L1
Format settings, BVOP : No
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : 20
Duration : 3mn 14s
Bit rate mode : Variable
Bit rate : 2 056 Kbps
Maximum bit rate : 5 928 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 3:2
Frame rate mode : Constant
Frame rate : 23.976 fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.248
Stream size : 47.7 MiB (94%)
Writing library : Lavc52.34.0
Encoded date : UTC 2010-03-10 21:29:55
Tagged date : UTC 2010-03-10 21:29:56

Audio
ID : 101
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 3mn 14s
Bit rate mode : Variable
Bit rate : 128 Kbps
Maximum bit rate : 135 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Stream size : 2.97 MiB (6%)
Encoded date : UTC 2010-03-10 21:29:56
Tagged date : UTC 2010-03-10 21:29:56
Lentgh: 3'14s

Any hints? TIA, Andrea

iMac 27" i7 2.8GHz 8GB, Mac OS X (10.6.4), iPhone 3GS (4.2.1) iPod touch (4.2.1)

Posted on Jan 24, 2011 8:46 AM

Reply
8 replies

Mar 12, 2011 4:54 AM in response to Andrea Rimicci

Found the reason. The "delay" value set up for the audio stream in mp4 container, was not honored in the windows version. Extracting streams, and merge them again with another tool and same audio delay, will works fine.

It was the delay option not correctly inserted into mp4 container, or not correctly handled in windows filter. Don't know which of the two apply, anyway this explain why some mp4 were offsync, and some not.

Mar 24, 2011 12:59 AM in response to Adamski11

I solved the problem adding white space to the audio stream, of same length of delay, then setup delay to zero.

About extraction and encoding, on win platform I used tools like Yamb to stream extraction, Audacity for white space, Avisynth and virtualdub for encoding, ffdshow as mp4 codec

On Mac, I just used the "make iPod version" feature of iTunes, to see the result on my iPod and iPhone.

Mar 24, 2011 1:09 PM in response to Andrea Rimicci

Many thanks - very helpful. How did you find the delay value that was set up for the audio stream but was being ignored? I've been working based on the "elst" edit list entry in my MP4 files but the issue I'm having seems to be related to something else so I'm wondering if your solution is based on finding the requried delay value from somewhere else in the MP4 container?

Mar 25, 2011 1:40 AM in response to Adamski11

Using mp4box (Yamb is a mp4box front-end) , you can mp4box -info "filename" and see different durations, in my case I noticed different values and the difference was exactly my missing sync, so I added the whitespace needed to make both durations the same and then multiplexed the streams.

How the "delay" value is inserted into the mp4 container, I don't know, because I don't know mp4 specs, but Yamb on multiplexing options, have the media delay value you can setup, this value will be inserted somewhere in container, but if you want exactly know where, it needs knowledge of the mp4 spec, I cannot help you on that.

So yes, I "guessed" the delay value was the difference in duration of both streams. There will be for sure a delay info in mp4 container, because other players will play fine the original mp4 without the need for all the process I done.

I'd like too go further into the internals of the issue, but I can do it just in my spare time, and to get full knowledge of mp4 specs surely require its time. It will be great have more details on why I had the problem with QuickTime. It may happen the problem was somewhere else and my workaround does not apply on all cases.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Video out of sync with audio

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.