Capturing is a hardware-intensive operation that requires saving a large amount of information to disk as quickly as possible. This information is typically in the form of video and audio data. Reducing bottlenecks that slow down the system is very important, because it can help improve the quality of the captured movie.
This article presents some general suggested practices and hints and tips that can help you, as the user of a capture application, set up the capture system for optimal capture performance.
Note Be sure to read your capture card manual for information specific to your capture card. Systems vary as well, so all the information presented in this article might not apply to your system configuration.
For a brief introduction to capture, see Capture Introduction. For a list of Microsoft® DirectShow® interfaces and articles relating to capture, see capture topics.
This article contains the following sections.
Capturing involves transferring a large amount of data from a capture card to disk. To get an idea of the amount of data and the data throughput required for a particular capture scenario, consider the following:
Suppose you want to capture a movie with a height of 320 pixels, a width of 240 pixels, a capture rate of 30 frames per second (fps), and in 24-bit color format. The movie does not include any sound.
Use the following formula to determine the number of bytes of uncompressed data that must be transferred every second in order to capture all of the image data, and therefore to maintain the image quality.
bytes of transferred video data = height (in pixels) x width (in pixels) x rate (in fps) x color depth (in bytes)
Plugging in the numbers from the preceding scenario produces the following result.
320 x 240 x 30 x 3 = 6912000 bytes of transferred video data
Capturing one second of this movie at the desired size, frame rate, and color depth requires approximately 6.9 million bytes of disk space. Multiplying by 60 seconds produces the results for a minute; each minute of capture requires 414,720,000 bytes in this case. You can reduce the amount of data required by reducing any of the parameters in the above formula: capture a smaller image, at fewer frames per second, or with fewer colors. However, in cases where your image requirements push the system to its limits and you need to be able to capture at the highest possible number of megabytes per second, you'll want to optimize your system as much as possible. After all, the capture settings you use affect how the movie will look when someone plays it back.
The preceding numbers are for a silent movie. If you want to capture audio as well as video, you have to add the amount of required audio data. For example, CD-quality audio, recorded at 44 kilohertz (kHz), 16-bit, stereo, requires about 172 kilobytes (KB) per second. Audio capture is also very CPU-intensive, and synchronizing the audio and video data (to achieve proper lip synch, for example) can cause delays as well.
You might find that your system can't keep up with the required amount of data transfer for the settings you've chosen. When capturing, your system might pause, the video might be jerky or jitter (not smooth), and some of the frames might be dropped (not saved to disk). Playback quality of such an image is typically unsatisfactory. To avoid such problems, you can follow a number of practices to optimize your system for capturing.
The suggestions presented in this article can help you reach the goal of optimal capture performance. At the same time, bear in mind that each system is different and something that improves performance on one system might not be effective on another system.
Because capturing is very hard-disk intensive, optimizing the files on the hard drive that you'll use for capturing (also called the data drive or data disk) is the most important task in optimizing capture performance. The following list contains goals in optimizing the data drive and techniques you might use to achieve those goals. The techniques discussed here are suggestions and might not be helpful given particular capture requirements. Your requirements and resources govern precisely which techniques you might want to try.
The heads of a hard drive can read from and write to a contiguous file more efficiently than if they have to seek to other, nonadjacent portions of the disk. Use a tool such as the Microsoft® Windows® Disk Defragmenter (Defrag.exe) to defragment your data disk. Defragment both the data drive and the operating system drive. The operating system drive comes into play when using drivers (such as audio and video drivers), writing to the system cache, writing to the registry, using overlays, and so forth. Run the Windows 9x Scandisk tool to ensure the integrity of the data drive and the operating system drive.
Allocating file space is time-consuming, so you should allocate your file before you capture. Capture software such as the DirectShow AMCap sample lets you allocate space for the capture file. If you capture more data than will fit in the capture file, the system has to allocate more space for the file as you capture, which, again, slows down capture. Avoid the reallocation of file space during capture, and the speed penalty, by allocating a file that is large enough to meet your needs. Saving the captured data can require as much space as the original capture file, so ensure you have enough free hard disk space to save your captured data to another file. Be sure to regularly defragment your capture file as well.
This technique is particularly useful under Microsoft® Windows NT® 4.x and Windows 2000, because they do not include a Scandisk or Disk Defragmenter tool. Reserving an entire disk or partition on the disk for the capture file can make it easier to keep the capture file space clean and contiguous. You can format such a disk or partition, and then preallocate file space again, or defragment it without having to worry about other files on the disk or partition. When you format a dedicated capture drive, use the full format to initialize the disk rather than a quick format that leaves old data on the disk.
Save your captured images to a directory that is not on your data drive or data partition to help keep your data drive clean. If you can't devote an entire drive to capture, allocate space for the capture file, defragment the file, and (in Windows 9x) run the Windows 9x Scandisk tool.
If you allocate the capture file as the only file on the disk, or as the only file in the first partition on the disk, it will begin at the outer rim of the disk. Access to the outer portion of a hard disk is faster than access to the inner portion of the disk. If you don't have a hard drive to devote to capture, you can use disk utilities to move your capture file to the beginning of the disk.
Revisit these goals as necessary before each capture session to ensure your disk is configured for optimal performance. Defragment the data disk before each capture session and defragment the drive containing your saved images before you play back the saved files.
The System applet of the Windows 9x Control Panel contains several options you can disable for optimal capture performance. In high-bandwidth situations such as capture, it's important to make sure the drive is writing as much data as possible and not spending time with software optimizations or checking for system changes. The options to disable include the following:
To access these options in Windows 9x, click the Start menu. Under Settings, click Control Panel, and double-click the System applet. Select the appropriate tab and proceed as shown in the following list.
You will have to restart your machine for the new settings to take effect.
Note For optimal performance for other applications, be sure to return these settings to their original values after your capture session is complete.
Anything that interrupts the system or consumes CPU time for purposes other than capture can potentially decrease capture performance. Consider performing the following tasks to see if they affect performance on your system.
This section contains a collection of hints and tips for improving capture performance that you might want to try after experimenting with the other suggestions in this article. The suggestions are grouped according to hardware and software-related suggestions.
Software
Hardware
Capturing is possible with a wide range of systems and capture cards. Shop around to compare capture cards and features to see what best meets your needs. For possible sources of information, see Suggested Capture Reading. The optimal hardware configuration varies depending on the capture card.
If you're setting up a new machine to devote to capture, consider a 166-megahertz Pentium or later, with 64 megabytes or more of EDO RAM (as much RAM as possible), and a 2-gigabyte or larger Wide SCSI 2.0 AV-certified hard disk. AV-certified drives are designed for high-bandwidth data transfer. The SCSI hard disk controller should support PCI bus mastering 2.0 and later, which uses 32-bit drivers. If your capture card supports overlays, ensure that your video card also supports overlays. Make sure the capture card has drivers for the operating system you plan to use.
This section lists possible sources of information about capture.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.