logo Sign In

Post #76827

Author
Zottig
Parent topic
.: The Zion DVD Project :. (Released)
Link to post in topic
https://originaltrilogy.com/post/id/76827/action/topic#76827
Date created
9-Nov-2004, 4:45 PM
VirtualDub Sync is what I think will be necessary to get the audio and video to properly sync up.

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).