PDA

View Full Version : Help Troubleshooting Sync issues


SZwabo
4th December 2002, 16:23
I am looking for any trouble shooting help I can get with my A/V sync capture problems.

Hardware:

Athlon XP 1700+
256 MB DDR
ECS K7S5A Mainboard (SiS735 Chipset)
Gainward GeForce4 Ti4600 Ultra 750 with VIVO
Soundblaster Live! Value
Western Digital WD1200BB 7200RPM 120GB 2MB Buffer Capture Drive

Objective:

I’m running windows 2000, trying to capture Digital Cable through the VIVO-in of the Gainward, and sound via the Line In jack of the Soundblaster Live. I am capturing to 720x480 HuffyUV 2.1.1, audio at 44.1/16

Problem:

My Audio will just not stay in sync. Sometimes it is out of sync from the beginning, sometimes it slowly drifts out of sync over the course of a 1 hr capture, and sometimes it just drifts in and out over the course of a capture.

I Have Tried The Following:

Virtual Dub
Virtual Dub_Sync with audio resampling
Virtual VCR with audio resampling
iu_vcr – but this only allows 640x480 for some reason so I did not try it much
Downloading and installing the newest Unified Driver from NVIDIA
Downloading and installing the newest NVIDIA WDM driver that is on the Gainward FTP site (v1.17)

Nothing I try seems to yield good synced video when I convert it -- I am at wits end – any suggestions? I would really like to get this working on this hardware set.


Other questions that have come up –

Would a dedicated PCTV Card yield more consistent results? -- But I have noted these also get sound via the sound card – so it seems unlikely.

At this point I have several poorly synced capture files….. Is there any reliable way .. time consuming or not…. To tweak or massage these files back into some sort of usable form?

Is there a huge quality difference between HuffyUV and PICVideo set on 20? At that level it seems to be not much of a compression difference – but the playback of PICVideo is much better – since as I understand it HuffyUV was never meant to be a playback codec anyway.

Anyone know exactly what the numbers on the bottom edge of the window in Virtual Dub_sync mean? I read the documentation, but I'm not following it very well.

Swan
6th December 2002, 01:04
SZwabo
It's been a couple of days and no replies, which I'm kind of puzzled by. This is a very interesting topic. Audio and video going out of sync during long captures is something I have been unaware of for a long time. I started capturing about a year ago, in Mpeg-2 format and have refined (and still do) the methods I use. Although the Mpeg-2 files I get look great when output on the TV, I have come to a point where I am ready for something new. Now I'd like to capture in a less lossy, easier-to-edit format and convert this to DVD-compatible Mpeg-2, buy a DVD writer and start making my own DVDs.

With the help of a more experienced Mjpeg-capturer, I started capturing using Picvideo's Mjpeg codec at setting 19, and the audio sampling at 48.0 kHz and immediately ran into seriously bad sync between audio and video. When watching the files, about 20 minutes I got an eerie feeling (is it sync or not), after 35 it was obviously not in sync and after an hour, it was a disaster. I got same results with HuffYuv.
This was new - and a shock - to me, I capture 1 hour's worth of Mpeg-2 every night and often a whole movie, without any sync issues at all. I have a separate capture card, so no, they're not any better.

Now, I have read a lot in the weekend, about why audio and video goes out of sync, tested Vdub sync, which was unreliable for me too. But I can't say I cared too much since I don't like the idea of what it does to the audio and don't want to use it. For me, the audio is just as important as the video.. The methods I have found on the web, and on the web site for Vdub sync, says what it's about and what solutions are available:

Problem: When capturing video with your TV-card and audio with your soundcard simultaneously, after some time audio becomes desyncronized with video. This is because the clock of the soundcard is not syncronized or locked to the framerate of the incoming TV-Signal. Thus the number of audio-samples per frame will change slowly in time. Ok, when adding some timestamps while recording, or using some data framing techniques and e.g. bit stuffing mechanisms, this is no problem anymore, when using these information for playback.
For short sequence capturing, that does not matter because this effect becomes visible only when recording some longer periods (depends on the quality of the soundcard-oscillator and on the oscillator(s) in the tv-broadcast-station or in your VCR).
In order to syncronize audio and video, all capture programs we know (Virtualdub, AVI_IO, etc.) throw away or duplicate frames when audio is behind or in front of video.

Solution:
In order to syncronize audio and video we apply a realtime sample rate conversion to the audio signal and do not throw frames away, anymore. That is, we have some means to permanently measure the time delay between audio and video during the capturing process and e.g. if there are too much audio samples per frame we reduce the number of audio samples in such a way, that there is no audible degradation (in the professional music domain, sample rate conversion is applied when mixing digital audio of different sources, but in a hardware-circuit like the AD1896 from Analog Devices). In order to avoid additional jitter, the measured time delay is feed into a servo loop with a high time constant.
So even when capturing many hours, the number of samples is as specified (e.g. PAL with 25frames per second and 44.1kHz audio sampling frequency, there have to be exactly 44100/25 = 1764 samples per frame).



Dropping frames to achieve sync? Resampling the audio? None of this is acceptable in my view.
Is there no format, no encoder, that can deal with audio and video sync like Mpeg does? It doesn't appear that way, but I'd love to be proven wrong.

By searching the Forums here, I have read about an analog video to digital video converter from Canopus (Canopus ADVC), which captures using DV compression using locked audio. The video is then transferred to the hard drive using Firewire. Is this the only method, if one wants to capture in a slightly lossy format and maintain audio/video sync over long captures without sacrificing audio (resampling) or video (dropping frames)?

I am not answering your question, or maybe I am. To me, it looks like there is no way to capture for a longer period of time in avi format with Mjpeg or HuffYuv compression and get a file with perfect sync (without accepting to use the methods described in the Vdub sync quote above).

I admit don't exactly know how Mpeg-2 works, but it does have some mechanism for keeping audio and video in sync. Presentation stamps, buffering, stuffing, something. It works, but I too would like to capture in a less lossy format and encode to Mpeg-2 when I am finished editing the files.

If anyone reading this has a Canopus ADVC, I'd love to read more about it. Are there other ADVC devices on the market with locked audio, at prices compared to that of the Canopus?

/Swan

SZwabo
6th December 2002, 15:32
Swan -- Thanks for the reply

I too have exhausted my interest in Mpeg 2 captures... In the past I have used both an ATI card and my ReplayTV to perform such captures and been disappointed with the look of the video. It was after downloading some SVCD others had created and seeing the great quality, reading their methods, I realized all the superior encodes I was seeing were captured (according to the authors) in HuffyUV. So I thought I would try that.

The results were breathtakingly better. The colors and sharpness and look of the video, even with my crappy cable, is loads better than any Mpeg capture I have done. If I reencode to SVCD via AVIsynth frameserve and apply a few temporal smoother, the noise is almost undetectable and the SVCD result is really much better than I ever thought I could produce. However, the audio is ALWAYS out of sync.

So there comes my post from that: How is it to make the sync issue disappear?

I too have read the paragraphs you posted, and I understand your misgiving about the twiddling with the audio. However, I must say I would suffer that in silence at this point just to get sync .

I have tried so many software, that I don’t think now they will ever solve my problem, so I am looking at hardware. My latest attempt is to switch out my audio card for a brand new one, since mine was very old. We shall see if this helps, since I start a 2 hour capture before I left the house this morning.

I think my next try if that is unsuccessful is to do a clean Win 2000 install and put on only the software to capture, to determine if something interferes with the process.

I also have a Sony TRV-17 Video camera, that can do DV capture and pass through to the PC via fire wire on the fly and I have done this as well. That may be somewhat similar to the Canopus product. This was an intermediate improvement, as these captures appeared superior to my MPEG2 captures, with no sync audio trouble, but the video is still inferior to my huffy captures. So I have left this behind to still pursue some Huffy method.

I really must say that I think Huffy is the way to go, nothing else I have tried even approaceches near the quality of the finished product.

I know from reading posts it appears others are doing successful huffy caps, I wonder what is their secret?

kempodragon
6th December 2002, 22:11
Swan, I use the "Sync video clock dynamically to audio clock" option in VDub during my caps with Huffyuv. Mind you, I do this with full resolution and 29.97 fps, and full 16bit, 44.1 KHz audio. Watching the info bar on the bottom, I've found that audio frame drops happen very rarely, with only 1 frame being dropped at a time. My soundcard is an old Soundblaster Live PCI card, so it is possible to get decent quality with older stuff. I've never had any sync problems or problems compressing the wav file with Lame. The key is to lower the CPU usage by setting a dedicated capture drive on its own ide or raid channel.
My average percentage during caps is 50-60%.
Forgot to mention that my capture drive is a 120 GB WD w/ 8MB buffer setup on a Promise Ultra 133 IDE PCI card on the primary master. I use the original VDub by Avery Lee, version 1.4.13 and Huffyuv 2.1.1. OS is Win2k SP3 (WinXp sucks!!), and video is ATI Radeon 8500 DV capturing digital cable signal through S-video and stereo cables. One more note, avoid "Lock video stream to audio stream" at all costs.

^^-+I4004+-^^
7th December 2002, 13:03
>One more note, avoid "Lock video stream to audio stream" at all costs.

what's the problem with that?


i heard that ADVC has sound problems in that mode...

( ok,ADVC is not same as VD but still could you explain that problem a bit more? )

SZwabo
7th December 2002, 13:14
Problem Solved For me!

After trying a brand new Sound Card to no solution, I was deinstalled HuffyUV 2.1.1 and then install HuffyUV 1.3.1 and immediate sync problems disappear. Last Night using Virtualdub-sync with audio resampling I captured 3 hours of video with no sync problems.

The solution is good to have but puzzling, I have no Idea why the newer version was not helping me.

To think of all the time I spent looking, and it was so simple an answer!

SZwabo
7th December 2002, 13:21
^^-+I4004+-^^:

I think the problem with locking the video to audio is explained on this page. http://www.digtv.ws/html/virtualvcr/sync.php


I just quote it here:

"The best way to deal with this is slow down or speed up one of the streams, the video stream is the easiest as you have two ways of doing this.

1. Add or drop frames to make the stream longer or shorter effectively speeding up or slowing down the stream. (VirtualDub uses this method)
2. Adjust the frame rate to speed up or slow down the speed of the stream.

.....

The big problem you face if you just alter the frame rate is that you can no longer use the video/audio stream to create an SVCD or and VCD as VCD requires a set frame rate of XXX where XXX is 25 for PAL etc. This means you need to use the Dropped frame method to sync the streams if you want to use the capture to create SVCD's"


Maybe "Lock video stream to audio stream" alters the Video Framerate.

^^-+I4004+-^^
7th December 2002, 13:38
till now we all now that theory , and we all
leave VD's "lock " function unchecked.....

video frame alteration is done when this is unchecked too
(so it's no that)

i think that ( frame drop/add ) is the stuff of "adjust video dynamically to match
audio" function....