PDA

View Full Version : Xvid audio out of sync after crop/resize


prefab
22nd January 2010, 15:00
I have several HDTV captures (MediaInfo at the bottom of the post) in AVI files encoded as XviD/AC3. These files play perfectly on wmp, VLC and SMPlayer.

I used VirtualDub to crop/resize to 720x576 and then saved as AVI encoded in Huffyuv/AC3. Previewing in VirtualDub is perfect, but once saved the AVI files gradually loose A/V sync and the difference is about 10-12 seconds after 1 hour.

I tried several combinations of compression with VirtualDub and several transcoders (SUPER, Mencoder) to AVI, XviD and MPEG, but the results are always a gradual loss of sync.

I am at a loss here, any suggestion is appreciated. Cheers


VirtualDub indicates the same length for Video (63898 frames - 42.35.92) and Audio streams (81789440 samples - 42.35.92). MediaInfo:
General
Format : AVI
Format/Info : Audio Video Interleave
File size : 1.22 GiB
Duration : 42mn 35s
Overall bit rate : 4 103 Kbps
Writing application : VirtualDubMod 1.5.4.1 (build 2178/release)
Writing library : VirtualDubMod build 2178/release

Video
ID : 0
Format : MPEG-4 Visual
Format profile : AdvancedSimple@L5
Format settings, BVOP : No
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Custom
Codec ID : XVID
Codec ID/Hint : XviD
Duration : 42mn 35s
Bit rate : 3 840 Kbps
Width : 1 280 pixels
Height : 688 pixels
Display aspect ratio : 1.860
Frame rate : 25.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.174
Stream size : 1.14 GiB (94%)
Writing library : XviD 1.2.1 (UTC 2008-12-04)

Audio
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : 2000
Duration : 42mn 35s
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Stream size : 78.0 MiB (6%)
Alignment : Split accross interleaves
Interleave, duration : 96 ms (2.40 video frames)
Interleave, preload duration : 96 ms

Asmodian
22nd January 2010, 18:38
Have you tried muxing the avi into a mkv? Just using something besides VirtualDub to mux the video+audio might fix it, as far as I know VirtualDub doesn't like muxing AC3 into AVI.

prefab
23rd January 2010, 14:06
Have you tried muxing the avi into a mkv? Just using something besides VirtualDub to mux the video+audio might fix it, as far as I know VirtualDub doesn't like muxing AC3 into AVI.Thanks for your reply Asmodian. I finally figured the problem is the AC3 audio file. It has about 120 CRC errors, that amount to the progressive 10 seconds delay. Any operation that converts it to PCM introduces this delay into the final video. Tried several tools for correcting AC3 but none worked. I am now croping/sizing the video separately and then I will remux the original AC3 back in. Thank you for the suggestion. Cheers.