Skip to content
Features

Guide to capturing, cleaning, and compressing video

Part one of our guide on video capture using the Hauppauge WinTV-dbx (401) …

Matt Woodward – | 0
Story text

Introduction

This guide is the first in a series on the Art of Video Capture, Clean-up, and Compression. This guide deals exclusively with the first step: Video Capture. Further guides will cover the remaining guides, and I encourage you to drop me a line with your suggestions for those articles. While many of the lessons to be learned in this guide apply to all platforms, this guide is written from the perspective of PC-based hardware, running Microsoft Windows (largely OS version agnostic). Furthermore, I’ve written this guide with the Hauppauge WinTV-dbx card in mind, and have chosen to use some fairly specific tools to take on certain tasks. No guide can be definitive, and as is the case with all technical matters, I’ve had to strike a balance between providing general information that’s of use to other configurations while also being in-depth enough at times using specific configurations in order to make some important points and observations. Finally, before I get started, I do want to point out there there are myriad other ways of capturing video, all of which cannot be treated here. There are other options of importing video such as analog-to-digital DV bridges (that can be had for $300).? Obviously, TiVo is a consumer solution that doesn’t support moving video off of the device (without hacking), and then there’s things such as Panasonic’s standalone DVD-R recorder, or the ATi All-in-Wonder. I’ve decided to go with a good-quality, low cost solution that also gives you the option of recording TV (I will treat the ATi AIW in a further supplement). For now, let’s begin with video capturing using a separate video capture card.

As we move into the 21st Century, traditional analog mediums such as vinyl, VHS cassettes, and TVs are being eschewed for superior digital ones, such as CDs, DVDs, and HDTVs. Not only does digital allow for higher quality content, but also it allows exact reproduction from copy to copy, barring any encryption technology implemented to stop copying. As computers become faster and disk storage space becomes larger, users are able to more deftly manipulate their digital data taken from analog mediums and frequently “improve” the original analog content using various techniques in the digital world.

This series
of guides will take you through an introductory course on the proper techniques
of capturing analog video, cleaning up the video capture, and encoding the
digital video into various new formats so that the original analog content can
live on into the 21st Century. The most common application for this
guide will be to make high-quality conversions of your home movies from VHS or
8mm tapes to DVD. You may also find yourself using this guide to create a digital
archive of your favorite television shows.

Capture Overview

In Part 1, we will be covering the following aspects of Video
Capture
:

  • Recommended Computer Requirements
  • Choosing a Video Capture Card
  • Downloading and Installing the Required Software
  • VirtualDub vs. VirtualDub VCR+Sync
  • Setting up VirtualDub VCR+Sync for the First Time:
    • Resolution
    • Color Space
    • Video Compression
    • Audio Format
  • Preparing to Capture
    • Checking the Audio Levels
    • Adjusting the Video Levels
    • Tweaks, Bugs, and Workarounds
  • Starting Your Capture and Troubleshooting Problems
  • Performing Timed Captures
  • Tips for Capturing Video from VHS or Camcorders
    • Video Connectors
    • Audio Connectors
    • Getting the Best Results from VHS
  • Final Words on Video Capture

Part II can now be found here.

Recommended Computer Requirements

  • x86-based PC @ 800+Mhz
  • 256+MB RAM
  • 40+GB of Free HD space (7200 rpm drive)
  • Microsoft Windows98/ME/2000/XP
  • Sound card with Line-in
  • Video Capture card

These are the minimum requirements to perform reliable video
capture. It is entirely possible to do video capture with less than this
configuration, but good results cannot be guaranteed. Obviously, a faster CPU,
more RAM, and more HD space are nothing but a good thing. Windows 9x/ME users
should be aware that the FAT32 file system has a limitation preventing files
from being larger than 4GB. We strongly recommend using a Windows 2000/XP
machine since the NTFS file system has no such file size limitation.

Choosing a Video Capture Card

There are
many cards on the market that can do video capture. You can purchase a video
card with video-in support built right onto the card, like the ATI
All-in-Wonder series of cards. You can also purchase a separate card dedicated
strictly to video capture, such as the Hauppauge WinTV card.

Or perhaps you already have a
digital camcorder, like a Sony Handycam, which has a built-in
“Analog-to-Digital Conversion with Pass-Through” ability. This feature is quite
useful since it will allow you to attach any analog device (VCR, 8mm camcorder,
etc.) to your Handycam and then stream the digital data over FireWire to your
computer. If you have this feature, you may want to skip to the end of this
article where we talk about “Tips for Capturing Video from VHS or Camcorders.”
Regardless, all of these options can get the job done equally well.

This
article features the Hauppauge WinTV PCI card for a few reasons. The WinTV is
based on the Brooktree 848/878 chipset, which is both well-documented and
widely used. Because this chipset is so common, it is commonly supported by
many Open Source projects, which yields more options to the end-user. And more
options are always good. Additionally, the overall quality of the WinTV drivers
and video is rather good and the hardware can be had for a rather thrifty $95
(or under $50 for a used one, if you check
eBay
or the Ars
Technica Agora Classifieds.)

Downloading the Required Software

All the pieces of software that we will be using, except for
one, are freely downloadable. Please click on each link and download each
specified software package.

  • The latest Hauppauge WinTV Software and Drivers
  • VirtualDub and VirtualDub VCR+SYNC
  • DScaler dTV v. 2.1.2 exe (do NOT choose a newer version)
  • Codecs (Encoder/Decoder):
    • PICVideo Motion JPEG (MJPEG)
    • Huffyuv 2.1.1

Earlier versions of the PICVideo MJPEG codec were previously
given away for free by PICVideo for non-commercial use. The latest version of
the PICVideo MJPEG codec can still be downloaded for free, but now contains a
watermark in the upper right corner of the video. For non-commercial users, the
watermark-free version can be licensed for a mere $18.

VirtualDub works best with Video-for-Windows (VfW) drivers.
While it can work with Windows Driver Model (WDM) drivers, support is quite
limited. If you have a need to use the WDM drivers, it is possible to use a
“WDM-to-VfW wrapper” and still get most of the functionality of VirtualDub. We
strongly recommend that you use the VfW drivers. (For WindowsXP users, there are
no XP-specific VfW drivers. Instead, please
download the NT/2000 VfW
drivers. They work fine with XP.)

For Hauppauge WinTV users, we do not recommend using the
software on the CD-ROM that came with your WinTV card since it is, most likely,
out-of-date. Please download the latest VfW drivers and WinTV2000 application
from the Hauppauge website.
Do not throw the CD-ROM away since it still has some useful software on it
which we will need later.

Also note that the VirtualDub VCR+Sync web page is in
German. Do not worry; the application itself is still in English.

Installing the Required Software

Since we
are using the Hauppauge WinTV card, we need to install the latest VfW drivers
(if you have not already). If the WDM drivers were previously installed,
download
“hwclear.exe” from Hauppauge’s website. This will uninstall all Hauppauge
drivers, applications, and registry entries so that you may start over from
scratch.

Install the
Hauppauge WinTV2000 application. Once installed, make sure the coax cable is
connected to the WinTV card. Also check that the Audio-Out from the WinTV card
is running to the Line-in on your sound card. Launch the WinTV2000 application
and allow it to auto-scan your cable to obtain a list of available channels.

Next
install VirtualDub and its cousin, VirtualDub VCR+Sync, by unzipping each
archive into their own separate directories. When both programs have been
unzipped, open “dTV212exe.zip”
and extract only “dtvdrv.dll,” “dTVdrv95.vxd,” and “dTVdrvNT.sys”
to both VirtualDub and VirtualDub VCR+Sync. These 3 files will allow use of the
BT8x8 Tweaker in VirtualDub.

Lastly,
follow the instructions for the proper installation of both the PICVideo MJPEG
and the Huffyuv codecs.

VirtualDub vs. VirtualDub VCR+Sync

Before
setting up for capture, it is important to understand why we are using two
related programs and when to use each one.

VirtualDub is an Open Source
program that supports both linear editing and video capture. While VirtualDub
performs both tasks very well, some people have found that VirtualDub tends to
“drop frames” too frequently during capture. Frame dropping can occur for many
reasons, but it happens most commonly when the synchronization between the
audio and the video stream drifts too far apart. VirtualDub treats the audio
track as the “master” source of timing. To compensate for the two streams going
out-of-sync and/or anomalies in the audio sampling, VirtualDub will frequently
drop (or sometimes add) a frame from the video to re-synchronize the streams
again. Frame dropping is undesirable when it happens at high frequency and
especially when two or more frames are dropped consecutively. Both situations
tend to degrade the video quality of the capture and should be avoided if
possible.

Since VirtualDub
is Open Source, it is free to be modified and improved by other parties.
VirtualDub VCR+Sync is a direct modification of VirtualDub. The ability to
setup timed captures just like a VCR was added. Additionally, a new audio/video
synchronization routine was added to reduce the likelihood of frame dropping.
For most people, the new “Sync” routine drastically reduces the number of
frames dropped during capture because it re-samples the audio stream on-the-fly
to compensate for any irregularities. For a small handful of people, the
original VirtualDub A/V Sync routine still works better at capture.
Experimentation is the only way to find out which one works best for you.

In the
first part of this series, we will be using VirtualDub VCR+Sync for capture since
it can utilize both the new and old “Sync” routine. For the second and third
parts of the series, we will use the original VirtualDub for editing and
compression.

Setting up VirtualDub VCR+Sync

  • Launch the WinTV2000 application. This will initialize your WinTV card and enable the TV tuner.
  • Tune to the desired channel and quit the WinTV program.
  • Start up VirtualDub VCR+Sync and enter “Capture” mode (under “File” => “Capture AVI” menu option.)

Set the Video Format parameters: Select “Video” => “Format”

The first parameter is Image Dimensions and is rather easy to
understand. Since we want to capture at Full resolution, click the “Full”
button. For people in North America and Japan, full NTSC resolution will
be 640×480. For those in the UK and most of Europe, full PAL/SECAM
resolution will be 768×576.

The second parameter is Image Format, and the difference between the
choices is not
immediately obvious. Image Format tells the video capture driver what “color
space” to capture in. The options in Image Format range from 32, 24, and 15-bit RGB to YUY2, YVU12, and YVU9. This begs the question: What is the difference
between these color spaces?

The following is a simple rundown of the different color spaces when concerned with video capture, based on information from Avery Lee,
the author of VirtualDub:

RGB Color Spaces:

  • RGB32: The same quality as RGB24 with the bonus of 33% more useless data due to an unused alpha channel.
  • RGB24: Although twice the horizontal color resolution as YUY2, the extra color resolution tends to get produced via upsampling. Thus with most capture devices, it will not produce any additional quality by using it, just 50% more unnecessary data. However, it is by far the most compatible format when it comes to video codecs.
  • RGB16: The same data rate as YUY2 (33% less than RGB24), but with significant banding. Good for video displays, bad for video archival.

YUV Color Spaces:

  • YUY2: In most cases, the best. The closest we can get to data right out of the video decoder. It offers significant speed/size improvements over RGB24 (it is 33% smaller). This is the preferred format of AviSynth 2.0.x and Huffyuv.
  • UYVY: A byte ordering change from YUY2. Either will do fine if both capture device and codec accept them.
  • YVU12 (YV12/I420): 25% less data than YUY2 in exchange for slightly more color bleeding vertically — this is the color space of VCD and DVD. There is no difference in luminance (light intensity). This format is now supported natively in AviSynth 2.5.x.
  • YVU9: 25% less data than YVU12 and 43% less data than YUY2, but significant color bleeding — this is the color space of Indeo. Overall, YVU9 is not very well supported. Not recommended at all.

It should be obvious now that the most desirable color space
to operate in for video capture is YUY2. It is important to note that
when converting to RGB from YUV or vice-versa, chrominance (color) anomalies
will be introduced into the video. The more often the video is converted back
and forth between color spaces, the worse the video color becomes. It is
generally regarded that one or two conversions will not harm your video, but 3
or more conversions will increasingly degrade the signal. Since the hardware
decoder on the capture card works in a similar color space as YUY2, we will use
this, so as to avoid performing a conversion.

Set the Video Source parameters: Select “Video” => “Source”

The first parameter is Video Connector.

  • To capture analog cable TV/video from the coax-in, select: Tuner
  • To capture video from your VCR’s composite-out, select: Composite
  • If you are running an S-Video cable from your Digital Cable/Satellite box, select: Camera and check the SVideo box. (This also requires that you run the audio from the Digital Cable/Satellite box to the Line-in on the sound card.)

The second parameter is Color. While these settings
are fairly obvious and can be tweaked in the range of 0 to 255, leave them set
at their default of 128 for now.

The third parameter is Standard and refers to the
video broadcast standard. As mentioned before, NTSC is used in North America
and many Asian countries. PAL is used primarily in the UK and most of Europe.
SECAM is used in France, Russia, and French-speaking African countries.

Understanding Video Compression used with Video Capture

Before
choosing a Video Compression codec and setting its parameters, it is important
to understand why Video Compression is used and what codecs are suited to the
task. So whip out your calculators. It’s time to start punching some buttons.

Full screen
video in the US, as we learned before, is captured at 640×480. The YUY2 color
space is 16 bits per pixel and there are approximately 30 frames per second.
Multiplying that all together: 640 x 480 x 2 bytes x 30 fps => 18,432,000
bytes per second (or roughly 17.5MB per second) for raw, uncompressed video.

While most
modern hard disks can perform sustained writes at 17.5MB/sec, some older models
typically cannot. Depending on the fragmentation of your hard disk, it is
entirely possible that the hard disk and Windows buffering might not be able to
keep up with your raw video capture. The result is lots of consecutively
dropped frames, which is never desirable. But even if your hard drive could
keep up a sustained write without dropping any frames, would it be able to
store what you are trying to capture? At 17.5MB per second, 1 minute of video
equals approximately 1GB of data. One hour would be nearly 62GB of data!

A common
solution to this problem is to utilize a real-time video compressor such as Huffyuv
or Motion JPEG (MJPEG). These codecs can yield good compression ratios with no
loss or virtually no loss of visual quality.

Huffyuv is a lossless encoder (meaning that
the visual quality is not degraded at all.) It has moderately low CPU usage and yields, on
average, a 2:1 compression ratio on a clean signal. On lower quality
and/or noisy video, the ratio tends to be more in the 1.4:1 to 1.8:1 range.
Huffyuv is typically suited for situations where preservation of quality is of
high importance and where hard disk space is not an issue. Common sources for
Huffyuv would be Digital Cable/Satellite, Hi8 camcorders, or any situation
where disk space is not at a premium.

MJPEG is a lossy encoder (meaning that,
depending on the codec settings, it can degrade the visual image very little, a
lot, or anywhere in between.) It has very low CPU usage. At its highest
quality setting, it typically yields a 4:1 to 8:1 compression ratio with no
noticeable degradation in visual quality. Lower quality settings yield higher
compression ratios at the expense of an increasingly degraded video signal. MJPEG is typically suited for situations where preservation of quality is still
important, but where disk space consumption is also an issue. Common sources
for MJPEG would be analog cable, VHS VCRs, or any situation with a slower CPU
and/or a requirement for more efficient use of hard disk space.

Setting up video and audio compression

Set the Video Compression parameters: Select “Video” => “Compression”

Select “Huffyuv v2.1.1” and click the “Configure” button:

As shown in the dialog box, there is very little to
configure. Select Predict median (best) for YUY2 compression method
and select Predict gradient (best) for RGB compression method.
These settings will utilize the CPU a bit more, but yield higher compression
ratios.

Next, select the MJPEG codec and click the “Configure”
button:

Once the dialog box opens, click the “Advanced >>” button to enter the Advanced MJPEG settings
mode. As shown in the dialog box, the settings for this MJPEG codec are
somewhat complex.

Slide the pointer to the Quality
setting of 19. This setting will yield an optimal combination of
compression with nearly lossless video quality. Verify that Subsampling
is set to 4/2/2 for optimum color sampling in the YUY2 color space. Make
sure that the Codec Enabled box is checked and that 2 Fields
If More Than [] Lines
is checked and set to 240 for NTSC or 288
for PAL/SECAM.

You may be tempted to check the “Force YUY2 Output”
box to ensure that your data is kept in the YUY2 color space, but it is
recommend that you do not. VirtualDub, when running in editor mode, operates
internally in the RGB color space. If output is forced to YUY2, then VirtualDub
cannot directly edit the captured file. Additionally, this can cause problems
with applications using the AVIFile-based IAVIFileGetFrame interface.

The Luminance (light intensity) and Chrominance
(color variation) Quality settings give even finer grained control
over quality vs. compression. In a nutshell, the higher the Luminance and
Chrominance values, the higher the compression and the lower the video quality
(and vice-versa). In general, when tweaking the values, always keep the
Luminance value a bit lower than the Chrominance value since the human eye is
more sensitive to light intensity than color variation.

Set the Audio Compression parameters: Select “Audio” => “Compression”

There is a multitude of different formats to choose from,
but the format with the best reproduction method is Pulse Code Modulation
(PCM). This is the same basic format that is used to record your music CDs. The
sampling attributes used for CDs are 44.1khz, 16 Bit, Stereo.
Alternatively, you can also use 48khz. Either recording rate is fine and
will faithfully reproduce the audio track with high accuracy. Although,
depending on the quality of the sound card in your system, you may find that
VirtualDub is able to maintain Audio/Video synchronization better at a certain
sampling rate. This is due to the fact that most consumer-grade cards only have
one oscillator crystal operating at a multiple of 22/44khz or 48/96khz. Again,
individual experimentation is required to find out which sampling rate results
in the least amount of dropped frames.

(Note: If you are running Windows2000 and do not have the
48khz option, but your sound card supports 48khz recording, you may need to
install Windows Media Player 7.)

Set the Capture Settings: Select “Capture” => “Settings”

Under Capture Options:

  • Set Frame rate to 29.97 for NTSC and 25 for PAL.

(do NOT click
“round to nearest millisecond”)

  • Make sure that Capture audio is checked.
  • Wait for OK to Capture is unchecked.

Under Abort Options:

  • Choose Escape as the “abort hotkey.”
  • Uncheck both abort on left and right mouse buttons.

(It is quite annoying to accidentally abort your
capture by bumping a mouse button. Be smart and disable both options.)

For the most part, the Advanced settings only apply
to “Compatibility mode” capture, which we will not be using. But we do need to
tweak the “audio buffer size.” According to the author of the “Sync”
version of VirtualDub, set it to 36000 for 16-bit stereo or 18000 for
16-bit mono.

Set the Capture Preferences: Select “Capture” => “Preferences”

In Capture Preferences:

  • Set the Default capture driver.
  • Set the Default capture file to a drive that has a lot of free disk space.
  • Check all 5 SAVE boxes.
  • Click OK.

All the parameters that you just set in the various dialog
boxes should now be saved. Next time when you start VirtualDub VCR+Sync and
enter “Capture AVI” mode, these parameters will be set the way you left them.

Preparing to capture

Just like
the space shuttle getting ready for blast-off, there are a number of procedures
to execute before capture. These settings are those that either cannot be saved
or ones that commonly reset themselves. It is very important to double and
triple check each one of these settings. Every time you go to capture video,
you should check these settings. To begin checking, start in the “Video”
=> “Overlay”
Mode.

Check the Audio Volume Meter: Select “Audio” => “Volume Meter”

In the image above, both left and
right VU Meters should be bouncing left and right across the screen indicating
that the mixer is receiving audio. If you find that there is no activity
in the VU Meters, click the Open Mixer button to open the “Recording
Control Panel.” Make sure that Line-in is selected and that there
is actually an audio cable running into your sound card’s Line-in jack from the WinTV card. If you are recording from an external source like a VCR, run the
audio directly into the sound card’s Line-in. (Do not run the external audio
source into the WinTV card since it will not get you anything except extra
noise.)

Setting the correct Volume for your
capture is essential. This is especially important since the volume can vary
from channel to channel and sometimes even from show to show within the same
channel. As shown in the VU Meter, the red bars indicate that the volume is
peaking at about half-amplitude. If you were to watch the VU Meter for a long
enough period of time, eventually you would probably see a few red bars peak
closer to the right side of the VU Meter. If the red bars hit the right side of
the meter, an audio phenomenon known as “clipping” occurs.

Clipping
makes your audio track sound really bad and distorted. Worse, it is
nearly impossible to fix clipping afterwards. If the red bars are frequently
hitting the right side of the meter, lower the Volume accordingly until
the red bars stop hitting the right side of the meter. As a rule of thumb,
always err on the side of being too soft since a sound track that is a
little too soft can easily be amplified later to the correct volume level. Also
note that a lot of shows have a fair amount of dialog which usually sounds
rather soft, but occasionally there are brief, loud passages (explosions,
shouting, laugh track, etc). If you set the audio levels too high during the
soft passages, clipping will occur during the loud ones. Be aware of this.

For those
using Hauppauge WinTV cards, a bug in the audio initialization routine may
affect you. When looking at the VU Meter, you may notice that unlike the diagram
above, the left and right channels appear to be the same loudness. If this is
the case, please launch the “AudioSel.exe” utility. (You may
need to retrieve this file from the CD-ROM that came with your WinTV card.
Place the executable in some directory on your hard disk.)

Once the Audio
Source Selector
utility is launched a small icon should appear in your
system tray that looks like a speaker with a red, green, and blue wave
coming out of it. Click on it. The following window should appear:

Select “TV
Audio Source
” and click the “Audio Config” button.

To fix the Stereo Separation bug:

  • Select “Mono”; then select “Stereo.”
  • Slide the “Mixer” to 0% and back to 100%.
  • Slide the “Separation” to 0% and back to 100%.

You should notice an audible difference in the sound coming from your
speakers. The audio should sound distinctly stereo instead of just mono. Click “OK”
and then click “OK” in the smaller dialog box to
minimize the “AudioSelector” to the system tray.

Using the Video BT8x8 Tweaker: Select “Video” => “Preview w/ Histogram” Mode

Upon entering
“Preview” mode, you may notice that the video becomes rather jerky. Do not
worry. When we begin capturing, the video will be smooth.

Select “Video” => “BT8x8 Tweaker” at the bottom.

You may
notice that there are black bars on the left, right, top, and/or bottom of your
screen. Use the Left and Right border controls to stretch the image to
fit your screen properly. If you use these controls properly, you will not have
to use crop/resize later.

The Top border control
cannot stretch the image vertically, like the Left and Right border controls.
It only shifts the video image up and down to preserve the fields/lines. Use
the control to push any video noise at the top or bottom off the screen area.
Be careful not to shift the fields so that the field order becomes reversed.
(It will usually be immediately obvious by the appearance of “jagged images” on
the screen.)

When you are done tweaking, leave the BT8x8 Tweaker
window open. (Do NOT click “OK.”) The BT8x8 Tweaker is an independent dialog
box which proactively adjusts the BT8x8 chip’s registers behind the capture
driver’s back. You can continue to use VirtualDub without closing the Tweaker;
just drag the window out of the way. However, please do not attempt to drag the
Tweaker window during capture as this will result in lots of dropped frames.

If any changes are made to “Source,” “Format,” or if
the display mode is changed from “Preview” to “Overlay,” you may notice that
your settings will briefly reset to their initial state and then revert back to
the settings you just made. By keeping the BT8x8 Tweaker window open, it
reasserts your settings over any changes the capture driver makes. If for any
reason, the Tweaker does not automatically reassert your settings, you can just
click the “Reassert” button.

More preparation and starting your capture

Tweaking the Video Levels: (still in “Preview w/ Histogram”
mode)

Setting the correct video levels
for your capture is critical. This is perhaps the most important setting
because it can mean the difference between a good capture and great capture.
Just like audio levels, video levels can vary from channel to channel and
sometimes even from show to show within the same channel.

To start, select “Video” => “Squish Luminance Range.” In the YUV colorspace, values from 0 ?
15 are considered “illegal” values. Enabling “Squish Luminance Range” should
not visibly change your video levels, but it will crunch any “illegal” values
into the standard CCIR range to prevent lossy conversion later on. Next, check
the Full Luminance Range box and check the AGC Crush box
on the BT8x8 Tweaker. This will probably darken your video a bit, but not
to worry; if you turn up the brightness dial on your monitor all the way, you
should be able to see that all the detail is still there. If you were paying
attention to the Histogram while you were checking the boxes, you might have
noticed that the white spikes seemed to move to the left. This is because we are
making sure that your black levels are truly black. In the histogram shown, the
left side is “dark” and the right side is “bright.”

If you are really interested in
this, you can conduct a quick experiment. Capture a video clip with Full
Luminance Range and AGC Crush enabled, and also capture one without them
enabled. In particular, you will want to capture a video clip where you have a
totally black frame (like between a commercial and a show).

Open up both video files (one at a
time) for editing in VirtualDub, load the Levels filter. Click the Preview
Video
button, move the slider bar to the black frame, and click Sample
Frame
. In the video that did not have Full Luminance and AGC Crush enabled,
you will probably see a black spike that is somewhat offset from the left side
(black). This is not good because the black levels in the black frame are not
truly black. In contrast, in the video that had both Full Luminance and AGC
Crush enabled, the black spike will appear on the very left side with the peak
of the spike appearing at about zero. This is good because now black is truly
black.

Getting back to setting our capture
levels, by enabling Full Luminance Range and AGC Crush, our black levels should
now be set properly. But as noted, the video may appear darker. To make the
video a little brighter, you can open up the “Video” => “Source”
dialog box. From there you can drag the Contrast bar slowly to the
right. This should increase the overall brightness of the video without messing
up the black levels.

Please be careful with the
Contrast setting
. Just like setting your audio levels, if the video levels
are set too high, you risk washing out your video and losing detail. This can
typically happen if you are working with an overly dark monitor. If in doubt,
err on the side of your video capture being not quite bright enough by leaving
contrast set to 128. You can always fix dark captures later in the clean-up
stage.

Starting your Capture and Troubleshooting Problems

Now that you have adjusted all the parameters and tweaked all the options,
you are ready to begin capture. Select “Video” => “Preview”
mode to exit from the “Histogram” mode. Click “Reassert” on the BT8x8 Tweaker, if you need to reassert your settings. Press F6 to start. (You
can press Esc when you want to end capture.)

In the upper-right corner of your window you will notice all these
statistics accumulating as the capture progresses. Most of the statistics will
be self-evident. While there is very little that you can do to help the capture
while it is running, you should pay attention to a few things while it is
running so that you can better fine-tune your settings for the next capture.

  • CPU usage ? Assuming you are using a single processor PC, this should always be less than 100%. If you find that CPU usage is 100% at any point, you will most likely end up dropping frames.

If you are running WinNT, 2000, or XP, open Windows Task Manager and click on
the “Processes” tab. Click on the “CPU” column to sort by CPU usage and try to
identify what programs are using the most CPU while VirtualDub is running. Other
programs can steal CPU cycles and can cause VirtualDub to drop frames.

  • Video Compression ? This just indicates what sort of compression ratio your codec is achieving. As mentioned before, you can tweak the Luminance and Chrominance levels on your MJPEG codec to achieve higher quality or higher compression. Compression settings cannot be adjusted in Huffyuv.
  • Frames dropped ? Ideally this should be zero. In real life, it varies. This author usually drops only 1 frame per hour of captured video. It is also not uncommon for a few frames to drop when starting up capture. While performing your first few captures, pay attention to this. If dropped frames occur, try to see if they are dropped in bunches or just single frames evenly over time.

If frames are dropped consecutively in groups, then you may be dealing
with a number of potential problems:

  • High CPU usage: If you find that your CPU usage hits 100% at any point during capture, you run the risk of dropping frames. To remedy this, we recommend switching your desktop from 24 or 32-bit to 16-bit. Running at a lower bit-depth puts less “load” on your CPU. Although the colors may not look as accurate on your display when running in 16-bit, the colors will still be captured accurately to your AVI.

You can also try capturing with “Preview” mode OFF or in
“Overlay” mode. When
you begin capture in these modes, VirtualDub will not display the current
capture in order to save CPU cycles.

  • Slow hard disk: Older and slower hard disks can cause frame dropping. Most hard disks with a maximum sustainable transfer rate of ~15MB/sec and/or 5400RPM drives with slow seek times often have difficulty keeping up with VirtualDub, resulting in dropped frames.

If you are using IDE drives, verify that UltraDMA is enabled for all your
hard disks. If UDMA is not enabled, this will cause slower writes and higher CPU
usage.

Hard disks that are extremely fragmented can sometimes have difficulty
keeping up as well. While there is no way to magically speed up old, slow hard
disks, you should de-fragment your hard drives when you can to ensure fast
writing.

  • Bus I/O and CPU contention: Sometimes certain programs and/or hardware devices can consume system resources like bus bandwidth, hard disk, memory, or CPU. Anti-Virus scanners are notorious for running at inopportune times. Not only will an Anti-Virus scanner require a good deal of CPU resources, but high disk usage as well. Check to make sure things like this are not scheduled to run during capture.
  • VHS with Time Base Errors: If you are recording from VHS, the playback may have time base errors. This frequently causes the capture card to drop frames because it cannot keep proper synchronization with the flawed video signal. This can usually be remedied with a Time Base Corrector. (See section on “Getting the Best Results from VHS.”)

If frames are dropped uniformly over a period of time, then you are
most likely dealing with an Audio/Video synchronization issue. VirtualDub
VCR+Sync normally handles this issue well, but feel free to experiment with the
audio recording sample rate. Try both 44.1khz and 48khz.

You are also encouraged to try the 3 different types of recording settings
under the “Capture” => “Timing” menu:

  • Option 1 is the special VirtualDub “Sync” method of dynamically re-sampling audio over time. This option seems to work best for most people, although a few find that it does not work well for them.
  • Option 2 is the original VirtualDub method of adding/dropping frames to match the audio clock. This works for most people at the expense of dropped (or sometimes added) frames.
  • Option 3 offers “no correction,“ which allows the audio and video to drift completely out-of-sync. This requires that the user resample the audio later (recommended) or change the frame rate later (not recommended) to compensate for the drift.
  • Timed captures, VHS, and Final Words

    Using the VCR function of VirtualDub VCR+Sync is quite easy, but we will walk
    you through the steps to using it for the sake of being complete.

    Select “Capture” => “Capture Timer”

    As shown, you can set up multiple captures with the capture timer. Merely
    fill out the Start Date, Start, and End fields with the
    appropriate information, and the length of the show will automatically be
    entered for you. Check the “Video” checkbox on the left side, and tune to
    the desired channel if you have Tuner support (Hauppauge owners will not have
    Tuner control). Then click “Save Timer” and then “Start Timer.” If
    everything is set properly, you will notice the timer at the top will begin
    counting down. Be sure not to click “cancel” or close this window; otherwise the
    capture will not start. Also, make sure that your system’s date and time are set
    accurately.

    Tips for Capturing Video from VHS or Camcorders

    Capturing Video from VHS or Camcorders is not particularly difficult, but
    there are a few things that should be covered to ensure a good quality capture.
    Depending on your make and/or model of VCR/Camcorder, you may have different
    video-out options. The most common is probably the Composite connector, which
    looks like a yellow female RCA connector. A few VCRs and most Camcorders have
    S-Video out and both will likely have the white and red RCA Stereo-out
    connectors for left and right channels, respectively.

    Video Connectors:

    If you have S-Video Out on your Camcorder or VCR, we recommend using
    this since S-Video carries the chrominance and luminance signals on separate
    circuits, resulting in superior picture quality.

    If you have Composite Video Out (the yellow RCA jack), you will still
    achieve good quality results despite both the luminance and chrominance signals
    being on one pair of wires. Since most capture cards, including the Hauppauge
    WinTV, only have S-Video In, you will need a Composite to S-Video adapter. The
    WinTV box has this adapter included. If you do not have such an adapter, you can
    pick one up from the local RadioShack for $20 (Catalog/Model #: 15-1238).

    If you have Coaxial RF Video Out (standard cable connector) on your
    VCR (not shown here), we do not recommend trying to capture video using this
    method unless it is your only option. Even though coaxial cables are shielded by
    design, they have to carry all the audio and video signals on one cable,
    resulting in lower audio and video quality.

    Audio Connectors:

    If you have Optical / Coaxial Digital Audio Out and sound card with
    Digital Audio-In
    , we recommend using this since it will transfer your audio
    in digital purity without noise or signal degradation. Most users will not
    likely have this option, but if you do, take advantage of it.

    If you have the standard Stereo RCA Audio Out and a sound card with an
    1/8″ line-in jack, you will need to purchase an RCA-to-1/8″ Stereo Y-Adapter (RadioShack
    Catalog #: 274-369) and a Stereo RCA Patch Cable (Catalog/Model #: 42-2352).
    They cost $5 and $6, respectively.

    Unfortunately, there is frequently a problem with running the analog
    audio-out from your VCR to your sound card’s line-in: Most VCRs are not grounded
    properly. Consequently, when you record the audio out from the VCR, you will
    find that there MAY be a 50 or 60hz “hum” on your audio track. It is possible
    that you will not have this problem, but if you do, you can remedy it by
    attaching one end of a wire (heavy gauge speaker wire will do) to the chassis of
    your VCR and the other end to a non-painted metal surface on the computer case.
    This should effectively ground your VCR and eliminate the hum.

    Getting the Best Results from VHS:

    As you are probably aware, VHS video can be notoriously unreliable, mostly
    due to the magnetic media that it is stored on. In addition to its flaky nature,
    magnetic tape degrades as it ages and especially with repeated use. Therefore,
    it is important that you use the best VCR that you have available to obtain the
    highest quality capture. As we will see later in Part 2 of this guide, we can do
    a lot of post-production clean-up to our video, but it is far more important to
    get a good, clean reproduction as a first step.

    If you really want the best possible playback of your VHS cassette, we
    heartily recommend getting a high-end “edit deck” like the Panasonic AG-1980 or
    the JVC SR-S365 which have high-quality components and built-in Time Base
    Correctors (TBC) for superb playback. These VCRs typically run in the range of
    $1000, although some used models sell on eBay for around $500. If this is too
    expensive for you, we recommend purchasing any consumer-grade SVHS deck since it
    will play back video better than any regular VHS machine, and it will have an
    S-Video Out jack. Good SVHS decks sell for $150 to $350.

    As an alternative to purchasing a high-end “edit deck,” you could purchase a
    good video image stabilizer like the
    Sima SCC digital color corrector. While this is not a TBC, this device allows you to tweak the brightness, color, tint, and sharpness of your video, as well as repair wobbly and unstable imaging. It frequently goes for around $100 and is a worthwhile investment if you plan on converting more than a few videotapes.

    Final Words on Video Capture

    Take some time to review this article and then play around with VirtualDub.
    Practice capturing video and take notes on what you did right and what you did
    wrong each time. After practicing capturing for a few hours, practice capturing
    from different sources, with different video codecs, and at different
    resolutions. See what your results are. Once you have it mastered, capture some
    of your favorite TV shows using the Timer.

    If you have taken the time to experiment, you will probably notice that
    captured files take up a lot of space and do not look that great on playback.
    Not to worry; this is because your capture is still in its “raw” state. Stay
    tuned. Cleaning up and re-compressing raw captures will be addressed in Parts 2
    and 3 of this series.

    A big, hearty “Thanks” goes out to Richard Berg and Avery Lee for their
    technical feedback and fact checking.

    Revision History

    Date Version Changes
    3/20/2003 1.0 Release
    6/11/2003 1.1 Changed description of Sima SCC
0 Comments

Comments are closed.