ALTE DOCUMENTE
|
||||||||||
Video capture in Windows is hardly a walk in the park, so here's a few tips to keep you going. As usual, corrections are welcome.
How fast of a CPU do I need?
This is a hard question to answer, but I can tell you what I've been able to do:
Celeron 300 @ 450, Hauppauge WinTV, 44KHz 16-bit stereo PCM, 640x480 YUY2 at 29.97 fps compressed with PicVideo at quality 18, on-screen display disabled.
Pentium III 733, Hauppauge WinTV, 44KHz 16-bit stereo PCM, 640x480 YUY2 at 29.97 fps compressed with Huffyuv in Predict Median, Preview on.
Note that these are with a 16-bit desktop. You will take a sizeable hit with a 24-bit or 32-bit desktop if you have Preview on.
VirtualDub says I don't have a capture device, but I know I have one.
VirtualDub needs a Video for Windows capture driver to capture. Most Firewire (DV) devices do not provide a VFW driver, and thus cannot be used by VirtualDub at all. Also, ATI appears to be shipping their current devices with a WDM (Windows Driver Model) driver only; this can be used indirectly by VirtualDub through a Microsoft wrapper, but it is crippled in functionality and it also appears that the wrapper is buggy.
The wrapper will show up as "Microsoft WDM Image Capture (Win32)." If it works for you, great.
I can capture DV through VirtualDub, but I get the audio out of my sound card instead.
Video for Windows only captures audio through a sound device; with DV, the audio is interleaved with the video itself. I don't have any DV specs, so I can't make VirtualDub extract the audio.
I get no sound.
First, check that you aren't missing the pass-through. Most video capture cards don't have on-board sound capture and instead use your sound card, so if you don't connect the cable from the capture board to the sound input, you won't get any sound.
Next, bring up Volume Control (sndvol32.exe), go up to the menu and choose Properties, then switch to Recording controls. Make sure Line-in, Aux, or whatever input you are using is selected. Voice chat programs are notorious for automatically switching inputs for you, and some video capture drivers are known to reset volume levels as well.
Finally, if you have a Hauppauge WinTV, check for an AUDIOSEL.EXE application on your hard disk or driver CD. It can be used to force the audio pass-through on for those cards. (Note: If you are using an external source with
I get sound, but it has cracks and
pops in it.
My video has greenish lines in it.
Occasionally, I see thin horizontal strips in the captured video that looks
like they came from the last frame???
No one has a rock-solid answer for why these problems occur, but it appears to be caused by contention on the PCI bus, which then prevents the sound card and video capture devices from emptying their buffers in time. This problem is reported more frequently on motherboards that have a VIA chipset, or in systems that have a SoundBlaster Live! sound card. In the former case, try upgrading your VIA 4-in-1 drivers first, and if that is not sufficient, check for a motherboard BIOS update that specifically addresses your problem. As for the Live!, the Creative driver is known to cause problems by lowering the latency timer of the PCI bus. (The result is similar that of making the red lights appear every ten seconds at a four-way intersection.) In that case, try installing the Microsoft drivers instead.
Also, check the websites for the hardware manufacturers to see if they have utilities which may help. For instance, Pinnacle has a PCI adjustment utility for some of their cards.
If you are using RGB24 for your raw capture format, switch to YUY2 to drop your raw datarate by 33% (see below), which may be enough to lower PCI bus load to workable levels.
I see a greyish, wavering line at the bottom of my capture. It looks sort of like the picture, but distorted.
If it's only a few lines at the bottom, it's likely VHS head switching noise. Ignore it or crop it out afterward.
I see a lot of thin lines in my image, like a comb.
That's interlacing -- what you're seeing is two fields, taken at slightly different times, and combined together to form a single frame. You'll see it whenever you capture with a height more than 240 lines (NTSC) or 288 lines (PAL). Interlacing is not a defect in the video and cannot be "fixed" -- it's a fundamental aspect of the way video is encoded.
Which capture format should I choose if I'm going to use video compression?
Ultimately, you will need to choose a format which is compatible with the codec, but if you have a choice, always choose YUY2, UYVY, or YVYU over RGB24. Here's why:
TV cards generally use one of two chips, either the Zoran ZR36120 (FlyVideo-derived devices), or the Brooktree/Conexant BT8x8 series (everyone else). If you look at the datasheets for these chips you will find that they either accept YUV 4:2:2 data from the decoder or produce it internally. Guess how they produce RGB24 data when you ask for it? You guessed it, the YUV 4:2:2 data is upsampled to RGB24. This means that the extra color resolution that RGB24 gives is entirely fabricated.
Choosing YUY2/UYVY/YVYU over RGB24 typically gives you a sizable speed increase, and gives you better compression with Huffyuv.
RGB16 introduces horrible banding and signal loss, while RGB32 just adds an extra 8-bits of junk to RGB24. There is no point in using either.
Why do I get errors when I try to capture with a height above 240 (288 for PAL/SECAM)?
This following only applies to devices based on the BT848(A) or BT878(A).
NTSC video is composed of alternating fields of 240 scanlines, and PAL/SECAM of 288. If you specify a height equal to or lower than that, the capture driver only snags one field. If you specify a taller image, both fields are grabbed. In either case when you specify a size smaller than the height of the field(s) captured, the result is then scaled down.
The BT8x8(A) can only DMA to one destination at a time, and the output pixel format can only be set on a per-field basis. If you specify Overlay mode, then the capture driver will instruct the chip to DMA one field to memory for capture, and the other field to the video card. The catch is that if you are capturing both fields, both DMA lists have to point to main memory. This means that overlay mode is impossible when both fields are captured, and depending on your exact driver, you will either have overlay disabled when the capture starts, or, as is more often the case, get a cryptic error about being out of memory. Note that this is not a bandwidth issue -- you can capture 640x240 in overlay mode, but not 80x480.
To "fix" the problem, specify Preview mode; this unfortunately is slower since the CPU is now doing a blit from the captured frame to the video card. It may be that your system is not fast enough to handle this, in which case you will need to disable the video preview entirely and capture blind. A secondary consequence of all of this is that you see exactly what is being captured in Preview mode, while you are actually seeing the other field in Overlay. If you have a strange source where one field is much cleaner than the other, it is possible with an Overlay display that you will see a clean display on screen and end up capturing crap. (I have had this happen.)
This may not apply to you if you have such a chip built onto your video card, since in that case the chip can DMA into video memory, and then other video hardware can transfer from there into main memory for capture.
Other people can capture 768x576, but my card doesn't do more than 640x480.
It's likely that the other people are dealing with a PAL (Phase Alternating Line) standard, while you are dealing with the NTSC (National Television System Committee) standard. PAL has fields of 625 scanlines at 50Hz while NTSC is 525 scanlines at 59.94 Hz. In addition to the resolution difference, PAL people should capture at 25 fps while NTSC people at 29.97.
I have lots of codecs in the normal video compression dialog, but some disappear when I go to capture!
You can only use codecs which are compatible with the current capture format, so try changing the capture format in the Video Settings or Video Format dialogs. RGB formats will give you the widest selection; YCrCb (YUV) formats will whittle the list down, and exotic formats such as VCR2 or MJPG will usually clear the list. This restriction is necessary because the for 424m1212e mat may require hardware assist to decode, and it may be impossible for VirtualDub to decompress the video during capture in order to transcode to another format.
What's the difference between compatibility mode and normal (internal) capture?
Compatibility capture mode (F5 key) is a no-frills, straight Video for Windows capture -- it lets Video for Windows do as much work as possible and is the failsafe mode you should use to diagnose problems when regular capture mode doesn't work. It has a number of disadvantages:
Timing correction is disabled, so audio on long captures may be out of sync.
The capture file will be invalid if it exceeds 2GB.
Only one capture file is allowed -- no multisegment captures.
VirtualDub won't be able to display the compressed video frame size.
Video filtering options that change the size of the frame aren't allowed.
Disk I/O is buffered, so you may encounter problems when pushing the limits of your hard disk bandwidth.
It's basically like Vidcap32.
Use normal capture mode (F6) when possible. If you find that you can't capture even in compatibility mode, chances are something is seriously wrong with your system configuration.
The audio isn't in sync in the capture file.
It's what we get for putting audio and video capture on separate clocks.
If you are running VirtualDub 1.4c or earlier, check the Knowledge Base for a possible workaround if your sound card isn't very accurate. (This problem will be fixed in V1.4d.) Also, if you're using compatibility mode, to capture, don't -- for VirtualDub to resync the audio during capture, you must not be using compatibility mode, and timing correction must also be active (it's in the capture menu).
The "lock video stream to audio stream" option in settings only works for compatibility mode; it sets the frame rate of the video stream so that it's the same length in time as the audio one. This is a nasty way to get audio in sync, because it will make editing harder -- to coerce the clips to a single frame rate for rendering, frames will have to be dropped or duplicated. It also doesn't work well if the timing relationship between audio and video drifts over the course of the capture.
Why am I dropping frames?
Perhaps one of:
Insufficient CPU power. If you're running near the limits (>90% CPU), then you can sporadically drop frames when busy scenes pass by.
Slow hard disk. Note that most hard disks cannot handle capturing full frame, uncompressed video; that requires 18MB/sec for 16-bit RGB/YUY2 and 27MB/sec for 24-bit RGB, not counting filesystem and seek overhead. Also, if you don't have DMA set on an IDE disk, you'll get slower performance than usual and additionally will load the CPU significantly during disk access, often by 40% extra or more.
Bus bottleneck.
Bad source, such as VHS video tape, or a signal interruption such as changing the channel.
Timing correction necessary to keep the audio synchronized. Most sound cards will deviate a small fraction from the video capture device, requiring that a few frames be dropped to keep the audio in sync. Another possibility is that the source is outputting a slightly slow or fast frame rate; old videotape can do this, as well as game consoles.
The key to remember is that one dropped frame per thousand is nearly indescernable, but ten dropped frames at a single point is.
Why does my video capture stop at 1 hour, 11 minutes, but I still get audio?
This is a bug in many video capture drivers. The exact limit is actually 232 microseconds, or 1 hour, 11 minutes, 34 seconds. Many TV tuner devices are susceptable to this bug, as are the miro/Pinnacle DCxx devices; you may be able to fix the problem simply by upgrading to the latest capture drivers. There are two incarnations of this problem. In the non-fatal version, video frames are still sent to the application, but the timestamp on the video stream starts over from zero. VirtualDub will correct for this problem automatically, allowing you to capture beyond 71 minutes. The other possibility is that the driver stops sending data altogether. VirtualDub will notify you if this occurs, but will not be able to capture past 71 minutes in this case.
Vanilla capture devices based on the Conexant/Brooktree BT848/878 reference drivers are usually either immune to the problem or have the non-fatal form of it. I'm told that the bug in Pinnacle's DC30(+) drivers still exists but is nonfatal as of the 1.41a drivers. As of this writing, the bug in the DC10/10+/20/20+ drivers is fatal and cannot be worked around.
There are apparently a few drivers that are even susceptable to half this limit (35 min.) due to using signed 32-bit arithmetic. VirtualDub does not yet detect or attempt to bypass the 35 minute limit that results.
I'm getting an error when I try to capture an AVI file bigger than 4GB.
You'll get this problem if you either (a) are running Windows 95/98/98SE/ME, or are saving to a FAT32-formatted partition. Either limits you to 4GB. If you want to capture a single file bigger than 4GB, you must have your capture partition formatted as NTFS and you must be running Windows NT/2000. The error message itself is caused by Windows, and not by the limitations of the AVI file format.
So how do I capture more than 4GB?
You must do all of the following:
Use normal capture (F6 key) and not compatibility mode capture (F5 key).
Check Capture/Enable multisegmented capture.
Add one or more drives to Capture/Spill drives. Set the thresholds to 50MB, and make sure you use a full path (i.e. E:\ and not E:). Also, set priority of all drives to 0 to avoid a bug in V1.4c.
VirtualDub will then capture in segments to a bunch of 2GB files.
How do I change the channel or capture in MPEG-1/2?
You can't -- this functionality isn't available through the Video for Windows capture interface. The application that comes with your capture device can do it because it uses a proprietary interface that other programs can't use.
It seems you can never compile someone else's application without a lot of hair pulling!
What do I need to compile VirtualDub?
You need Visual C++ 6.0 SP5 + Processor Pack and Microsoft Macro Assembler (MASM) 6.15. The Processor Pack is a free download from Microsoft's website, although you will need to patch to SP5 first (this is mandatory anyway since some pre-SP3 bugs will cause VirtualDub to miscompile). It also includes MASM (ml.exe) as well. If you don't have the Processor Pack installed, the SSE instruction sfence will not compile.
What are the verinc and mapconv tools?
verinc is my automatic build number incrementer, and mapconv generates the .dbg files used to generate stack dumps on a crash. mapconv can be safely removed from the VirtualDub.exe post-build step without problems, but verstub.asm still needs to be compiled.
Download source code for mapconv and verinc from virtualdub.org (HTTP).
How should I lay out the directory structure when I unzip the archives?
The source and auxsrc distributions can go into any directory, although VirtualDub just might be a good name for it. NekoAmp should go into amplib_new and Sylia should go into sylia, with both directories at the same level as the VirtualDub directory.
What's INVALID_SET_FILE_POINTER
A macro constant included in recent versions of Microsoft's Platform SDK, which has newer Win32 includes than the original Visual C++ 6.0 distribution. Install the PSDK includes or use:
#define INVALID_SET_FILE_POINTER ((DWORD)-1)
VC++ says it can't find IAMPDecoder.h
You need to install the NekoAmp source code and headers. By mistake, some of VirtualDub's modules refer to an amplib directory in their preprocessor settings; they should all be pointing to amplib_new
VC++ says it can't find IScriptInterpreter.h
Install the source code and headers for the Sylia scripting language in ../sylia
When I recompile VirtualDub, the executable is over a megabyte, instead of the 380K yours is!
Don't release Debug mode builds; change the build target to "VirtualDub - Win32 Release." (You're not supposed to ship debug executables anyway, as the Visual C++ debug RTL isn't redistributable.)
I'm building a Release build now, but it's still over 800K.
I cheated -- the release VirtualDub.exe is compacted with UPX
Isn't assembly language dead with modern compilers?
void add_pairs(float *dst, const float *src, int count) while(--count);What was that again?
There are a few areas of VirtualDub that are rougher than they should be. The least I can do is document it.
How do I crop a video?
VirtualDub allows you to crop at the beginning of any video filter; you can do it by clicking on a video filter and then "cropping." This option is called "clipping" in versions prior to 1.4. If you don't have any video filters you want to run, add a "null transform" filter and then add cropping to that.
The reason you can crop before any filter is that filters that are spatial (area-based) tend to exhibit artifacts at the edge of the image, where the area filters are poorly defined. You can sometimes get more natural results by applying the blur/sharpen/etc. first and then cropping afterward.
You cannot crop in direct stream copy mode -- the cropped video must be recompressed. That's life.
Why does the sound stutter during playback?
This will occur if your CPU isn't fast enough to handle real-time preview. When checking the results of filtering, it's better to be able to see all frames in slow-motion rather than to see a sync'ed, 1 FPS slideslow. You can enable the "drop frames when behind" option in the menu, but it's not very effective in most cases and can simply lead to a 1 FPS, stuttering slideshow. If you must see the results in real-time, using frame rate decimation is usually far more effective.
Short answer: VirtualDub is not a player.
I tried to cut out some frames in direct stream copy mode, and VirtualDub put them back in!?
You deleted a frame, but didn't delete the non-keyframes after it.
A keyframe is a frame that can be decoded on its own; a non-keyframe, or delta frame, is a difference from the previous frame and cannot be decoded if the frame before it is missing. VirtualDub always plays it safe and makes sure that all frames that you don't delete are decodable. This means that any non-keyframe that you include will force inclusion of any frames before it, back to and including the previous keyframe.
Below the position slider and to the right of the motion buttons, there is a timestamp counter that shows the current position:
Notice the [K] at the end -- this is the current frame type. K indicates a keyframe; nothing indicates a delta frame; [D] indicates a dropped frame, which is another type of non-keyframe. Basically, all you have to do is ensure that when you delete a segment, you end the delete right before the next keyframe. You can seek between keyframes by holding SHIFT when dragging the nub or clicking on the forward and backward buttons with the yellow key icon.
How come VirtualDub doesn't let me compress into MPEG layer III audio, or only up to 56Kbps?
Audio compression is handled by third-party Windows ACM drivers, not by VirtualDub itself. The MP3 compression driver comes from Fraunhofer-IIS and has a few incarnations, with the filenames L3CODECX.ACM L3CODECA.ACM, and L3CODECP.ACM. If you don't have any MP3 options, you either don't have the L3 codec installed at all, or have the standard version (L3CODECX). A 56Kbps limit means you have the Advanced version; 128Kbps means you have Professional; 320Kbps means you're using the warez Radium hack.
I can't tell you where to find these codecs, unfortunately, and I suspect they aren't redistributable in any case.
Listed below are a few common VirtualDub crashes that are related to third-party drivers. If you get a crash in VirtualDub, one of the entries below may help you track down the problem. The "symbol containing EIP" will appear as the top entry in the estimated call stack, in the form of dll name ! export. If the top entry contains only a name rather than a DLL name and an export name, it's probably a crash in VirtualDub itself and you should reference the Knowledge Base instead.
As usual, the information you get out of a crash dump may be suspect, so a crash in a particular DLL does not mean that that DLL is bad. However, the DLL implicated in the crash dump may give you a clue as to what's going on.
Operation |
Faulting instruction |
Crash reason |
Symbol containing EIP |
Compressing to Huffyuv |
pxor mm2,mm2 |
Illegal instruction |
HUFFYUV.DLL!DriverProc |
Huffyuv requires a CPU with MMX support, and yours does not support MMX instructions. |
|||
Compressing to DivX 4 |
fcomip st(0),st(1) |
Illegal instruction |
DivX!encore |
DivX 4.11 and 4.12 will not work on a Pentium, Pentium MMX, or AMD K6/K6-2/K6-3 due to use of a Pentium Pro instruction. |
|||
Selecting video compression codec |
cmp [eax+0c0000h],dl |
Access violation |
asusasv1!DriverProc |
If you upgrade a Windows 9x system containing an ASUS video card with capture capability to Windows 2000 or XP, you may inherit the ASUSASV1 codec. This codec uses a method of checking for an ASUS video card which does not work under any Windows NT platform and causes host applications to crash. Install the decompression-only ASUSASVD driver from the Asus web site to work around this problem. |
Sure, you've probably played a few video clips on your monitor. But have you ever made one yourself? Used a video capture device? Wrestled with the software that comes with it? Felt like the software is a few leagues above or below your level? Time to try something else.
If your capture device is Video for Windows compatible, then VirtualDub can capture video with it. But VirtualDub isn't your average capture program:
There are lots of programs that let you "edit" video. And yet, they're frustratingly complex for some of the simplest tasks. VirtualDub isn't an editor application; it's a pre- and post-processor that works as a valuable companion to one:
You can take a captured clip, trim the ends, clean up some of the noise, convert it to the proper frame size, and write out a better one. Don't see a video filter you want? Write your own, with the filter SDK.
The author of VirtualDub is very impatient. That means his program is designed for speed, both in the interface and in the processing pipeline. Converting a compressed, 320x240 MPEG-1 file to an uncompressed, 24-bit AVI requires only these two steps in VirtualDub:
How fast is this operation? On a C450, 40 frames per second (1.3x real-time speed). With a little tweaking, the speed rises to 55 fps (1.8x), with the CPU hardly breaking a sweat at 40%.
To be exact, it costs nothing. VirtualDub is licensed under the GNU General Public License, meaning you can use it for free. No risk involved, and the whole source code is available if you want it.
I've decided that I don't have the time or energy to hunt down and maintain a list of all the current video filters available for VirtualDub, so I've appointed Donald Graft as honorary filter website maintainer. You can find his own filters, and a comprehensive list of other third-party filters, at:
https://neuron2.net/
You'll find my own subtitler filter below, if you scroll down.
VirtualDub filters can be loaded manually by clicking on the Load button that appears in the Add Filters dialog box. They can also be automatically loaded at startup if you copy the .vdf file into a plugins subdirectory under the VirtualDub program directory. It is possible, although unusual, for filters to conflict with each other, so if you have problems with a particular filter chain you might want to try testing each filter individually to narrow the scope of the problem.
Download
subtitler-2_4.zip from virtualdub.org
Download
subtitler-2_4-src.zip from virtualdub.org
Download
subtitler-2_3.zip from virtualdub.org
Download
subtitler-2_3-src.zip from virtualdub.org
Download
subtitler-2_2.zip from virtualdub.org
Download
subtitler-2_2-src.zip from virtualdub.org
Download
subtitler-2_1.zip from virtualdub.org
Download
subtitler-2_1-src.zip from virtualdub.org
Description: Applies Sub Station Alpha v2.x/4.x scripts to video.
Supports
batch operation: Yes
Updated: (V2.4) Fix for another crash.
Pretty self-explanatory; handles most of the common features in SSA scripts. It has text antialiasing, so your subtitles look good at small sizes.
Download warpsharp-1_1.zip from virtualdub.org Download warpsharp-1_1-src.zip from
virtualdub.org
Description: Sharpens images by warping pixels toward edges.
Supports batch operation: Yes
Updated: (V1.1) Adds bicubic filtering and performance optimizations.
Sharpens images through warping rather than convolution. Most effective on cartoon-style animation.
Note: This filter won't work in Avisynth because it uses the BitBlt() function from VirtualDub -- Donald Graft has a version on his site which will work.
VirtualDub has the capability to load third-party DLLs that include their own video filters. The filters that are built into VirtualDub use the same interface that is exported to DLLs, so you can write filters similar to or better than the included ones. You can sample some of these at the third-party filters page; these range from corrective filters, such as noise reducers, to synthesis filters, such as the subtitler. The basic interface is simple to work with: VirtualDub gives you a 32-bit ARGB bitmap to modify.
Requirements for the filter SDK:
Download filter SDK 1.05 (filtsdk-1.05.zip, 66K zip file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|