Log in

View Full Version : Increasing audio/video desync in uncompressed .avi


w4tt4n4b3
23rd April 2009, 22:09
I capture with my Leadtek Winfast 3200 H card in uncompressed .avi using the WinFast PVR2 software.
The produced .avi file features an increased audio-video desync.
In the beginning there is no desync but after 2 hours is more than visible.

Capture card settings:
(click on the thumbnails to view larger)
http://img209.imageshack.us/img209/2796/wfpvr2.th.jpg (http://img209.imageshack.us/my.php?image=wfpvr2.jpg)
http://img510.imageshack.us/img510/6510/wfpvr2captureformat.th.jpg (http://img510.imageshack.us/my.php?image=wfpvr2captureformat.jpg)

Details about the uncompressed .avi file:
General
Complete name : C:\WinFast WorkArea\Video_0423-1657(COMPONENT).avi
Format : AVI
Format/Info : Audio Video Interleave
Format profile : OpenDML
File size : 182 GiB
Duration : 2h 40mn
Overall bit rate : 163 Mbps

Video
Format : YUV
Codec ID : YUY2
Codec ID/Info : YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel
Duration : 2h 40mn
Bit rate : 162 Mbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 5/4
Frame rate : 24.980 fps
Standard : PAL
Resolution : 16 bits
Bits/(Pixel*Frame) : 15.592
Stream size : 181 GiB (99%)

Audio
Format : PCM
Format settings, Endianness : Little
Format settings, Sign : Unsigned
Codec ID : 1
Codec ID/Hint : Microsoft
Duration : 2h 39mn
Bit rate mode : Constant
Bit rate : 1 536 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 1.72 GiB (1%)
Interleave, duration : 40 ms (1.00 video frame)

What I would like is to find a way to prevent this desync from happening or find a way to fix it but not with big time cost...
If you have any ideas, solutions or suggestions, I would like to read them.
Thank you.

w4tt4n4b3
24th April 2009, 23:14
Not any suggestion or idea?

GrofLuigi
25th April 2009, 06:15
I am not familiar with this card, but try capturing with a program that resamples audio (http://virtualvcr.sourceforge.net/html/virtualvcr/sync.php) (if it can work with your hardware/driver). VirtualDub and VirtualVCR do that.

GL

w4tt4n4b3
25th April 2009, 10:15
I used VD to capture and after 2 and half hours 0 frames dropped but I noticed that 9 frames were inserted. I had selected the option Capture->Timing->Sync audio to video by resampling the audio to a faster or slower rate.

Then when I try to encode using staxrip or megui should I force the fps to be 25fps or should I leave it to whatever it is from VirtualDub capturing?

GrofLuigi
25th April 2009, 21:13
I used VD to capture and after 2 and half hours 0 frames dropped but I noticed that 9 frames were inserted.
For all practical purposes, consider it to be the same as dropped frames. The capture card delivered frames too far apart. There were glitches in the stream, caused either by signal dropout (tape defect or broadcast interruption) or it was a cumulative desync that has gone too far. :mad:

I had selected the option Capture->Timing->Sync audio to video by resampling the audio to a faster or slower rate.
Try playing with other options too. On VirtualDub forum (http://forums.virtualdub.org/index.php) I've seen different things work for different people. I guess it depends on the hardware, and I don't know much about your card.

Then when I try to encode using staxrip or megui should I force the fps to be 25fps or should I leave it to whatever it is from VirtualDub capturing?
I think it's essential to insert

AssumeFPS (25,sync_audio=false)

in the AviSynth script, but I'm not sure about the second part. This was recommended (http://forum.doom9.org/showthread.php?p=1277499#post1277499) in a similar thread.

GL

w4tt4n4b3
25th April 2009, 21:42
Thanks a lot mate...

GrofLuigi
26th April 2009, 00:19
Thanks a lot mate...

You're welcome! :)

GL

AVIL
26th April 2009, 04:18
Hi,

You can try VirtualVCR (http://virtualvcr.sourceforge.net/).

Another approach (if desync is definitively unavoidable) is to demux audio with Virtualdub, change his duration with an audio editor (i.e. audacity) to exactly match video duration and remux again with virtualdub.

setarip_old
3rd May 2009, 20:54
@AVIL

Hi!Another approach (if desync is definitively unavoidable) is to demux audio with Virtualdub, change his duration with an audio editor (i.e. audacity) to exactly match video duration and remux again with virtualdub.What you've described can be more easily accomplished (without demuxing, remuxing, or using an audio editor) using only VirtualDub as follows:

Load the file into VirtualDub, VirtualDubMod, or NanDub.
Set BOTH "Video"(VirtualDub,
VirtualDubMod and NanDub) and "Audio"
(VirtualDub and NanDub - VirtualDubMOD>"Streams>"Stream
list") to "Direct Stream Copy".

A) If the difference between audio and video is constant
throughout the video:

From the "Audio" dropdown menu, select "Interleaving" (For
VirtualDubMOD, rightclick on the listed audiostream and then
select "Interleaving")

Under "Audio skew correction", set an appropriate number of
milliseconds (positive or negative) in the box labelled "Delay
audio track by"

Save with a new filename

B) If the difference increases as the movie plays:

From under the "Video" dropdown menu, select "Framerate" -
and select "Change so video and audio durations match"

Save with a new filename.

AVIL
4th May 2009, 18:36
Hi setarip_old,

W4tt4n4b3 says:

In the beginning there is no desync but after 2 hours is more than visible.

then your preferred solution is B:

From under the "Video" dropdown menu, select "Framerate" -
and select "Change so video and audio durations match"


It will be a very good approach if framerate must not have a fixed value. But in other cases (i.e. DVD authoring) fails.

w4tt4n4b3
4th May 2009, 21:17
With the following setting there is no desync in any case...
http://img24.imageshack.us/img24/3929/audioresample.th.jpg (http://img24.imageshack.us/my.php?image=audioresample.jpg)