A/V Sync Question

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
LonestarOrison
Posts: 46
Joined: Fri Jul 23, 2010 2:17 am

A/V Sync Question

Post by LonestarOrison »

Why is it that HandBrake has to constantly add silence or delete video frames in order to keep A/V sync? Is it because of a deprecated audio encoder (faac)? Or is because of something else that I'm not considering?

Certainly, the video alone would not lose timing. X frames per second in a source is still X frames per second in the output, and this is true for anything where the frame rate is the same as the source. I can understand how audio would be much more difficult to keep timing with, I mean, there's no arbitrary rate that the encoder can use as a reference. So my question, really, is related to audio encoders. Is is a fault of faac that audio goes out of sync (so is it a problem that could be resolved by, for example, using the CoreAudio codec on a mac?), or is it something else?

I'm asking this because the times when silence is added or frames are dropped is quite noticeable, despite the fact that (it seems so anyway) recent developments have forced these changes to take place when scenecut tells x264 to use an I-frame.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: A/V Sync Question

Post by JohnAStebbins »

Please provide activity logs. It would be ideal if you could supply a short clip of a source that demonstrates your problem.

HandBrake drops frames or inserts silence in order to keep A/V sync. It only does this when it thinks that not doing it will cause audio and video to become unsynchronized. It bases this on the timestamps it sees for each audio and video packet. Either you have uncovered a bug, or your sources have issues with their timestamps. It is fairly common for sources to have timestamp issues. You wouldn't notice it during playback with most players because a good player is going to do the same thing handbrake does and adjust to keep a/v sync in some way.
LonestarOrison
Posts: 46
Joined: Fri Jul 23, 2010 2:17 am

Re: A/V Sync Question

Post by LonestarOrison »

It's not a problem haha, just a question to see whether or not these skips could be avoided by any means (because other encoders don't seem to have to drop frames or insert silence, eg QT).
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: A/V Sync Question

Post by TedJ »

Yes, I don't think I've ever seen those messages in the quicktime encoder logs... what? Quicktime doesn't generate log files? It doesn't tell you anything about what's happening behind the scenes? ;)
LonestarOrison
Posts: 46
Joined: Fri Jul 23, 2010 2:17 am

Re: A/V Sync Question

Post by LonestarOrison »

Haha fair point. But even when you use MPEG Streamclip with x264Encoder, or any other codec for that matter, the program's claims of having "perfect audio/video sync" stand true. I'm just wondering what the difference is there.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: A/V Sync Question

Post by JohnAStebbins »

Like I said before, it is possible there is a bug causing issues. There is no way to tell without a sample of a source the demonstrates the problem.
Post Reply