[Fixed] [svn2979] Out-of-sync audio unless I resample

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
User avatar
Rodeo
HandBrake Team
Posts: 12569
Joined: Tue Mar 03, 2009 8:55 pm

[Fixed] [svn2979] Out-of-sync audio unless I resample

Post by Rodeo »

For the past few months, I've been having issues transcoding some of my EyeTV recordings (H.264 and some form of AAC LC - apparently using SBR judging by the logs).

The files crash with 0.9.3, and with 0.9.4 the video is fine but the audio isn't (HandBrake keeps adding silence everywhere, and the audio track is way longer than the video).

With svn2979 and the new ffmpeg revision, I finally do get audio, but it's out of sync with the video. However, when I tell handBrake to resample the audio from 24 to 48 kHz, the problem appears to "fix itself".

You'll find a zip archive containing a short sample of the source, and encodes of 0.9.4 at 24 (Auto) and 48 kHz, and svn2979 at 24 (Auto) and 48 kHz (including the logs) here:

http://localhostr.com/files/6243c6/Audio%20sync.zip

I realize this may well not be a HandBrake bug, but I was wondering if there'd be a way to get the audio to be in sync without having to resample?
van
Veteran User
Posts: 417
Joined: Wed Aug 29, 2007 6:35 am

Re: [svn2979] Out-of-sync audio unless I resample

Post by van »

Thanks for the careful analysis & sample file. The bug should be fixed by r2985. It was an ancient bug and would cause A/V sync errors any time the source rate was less than 48KHz (e.g., this was probably causing the A/V sync errors people reported for 44.1 mpeg audio in .mpg files). The reason it worked if you forced resampling is because the resampler essentially ignores the input frame timestamps (which were wrong because of an integer divide truncation bias) and computes its own based on cumulative samples & output sample rate.
User avatar
Rodeo
HandBrake Team
Posts: 12569
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Fixed] [svn2979] Out-of-sync audio unless I resample

Post by Rodeo »

Yes, r2985 fixes the issue - not only is the audio in sync, but there no longer is a short silence at the beginning of the file like there was before even when resampling.

Thanks :D
Post Reply