Capture anything in your screen using VirtualDub

Thread in 'Discussion' started by PetitPrince, 5 Aug 2008.

  1. (yes, this may be in the wrong forum

    So, you've got a nifty record done with your soviet mind game clone, and want to upload it to dailyvitube 6, and you wonder how to capture your l33t sk1lls ? Here's how I do.

    You'll need:
    • A powerful computer: capturing video is a CPU-intensive process. Be sure to have enough power left to run the game.
    • A lot, lot of hard-disk space. A 10 minutes long game can take up to 6 GB.
    • The following software
    1. Recording your game
    Some use Camtasia or FRAPS to record their game. I use the combination of VirtualDub and UScreenCapture.VirtualDub is a well-known video editing tool. UScreenCapture is a filter that record your screen that can be used in VirtualDub.

    For this guide, I'll use Lockjaw.


    Firstly, install UScreenCapture. Then, open VirtualDub and go to Menu > Capture Avi. You'll get to another part of VirtualDub. Now, go to Device and make sure UScreenCapture is selected. Then, open Video > Capture Filter.


    That will lead us to UScreenCapture setting screen.


    In this window, we'll tell UScreenCapture which area of your screen it should record. We'll do that by entering the coordinate of the area we want using the right part of the window. The unit is in pixels. You can either use an image manipulation program (Paint, Photoshop, Gimp, Paint.NET, etc..) and use a screenshot do determine it, or you can go by trial and error with VirtualDub preview, or you can just capture a large area and use VirtualDub to crop the unwanted area (though you'll definitely need a huge hard-disk). Oh, and don't touch the

    Now, to the recording itself !

    You need to set what in what file your stream will go in File > Set Capture file (or press F2). Be sure to also record the audio (Audio > Enable audio capture), and the record the sound coming from your PC and not from your mic or webcam (Audio > Audio Input > Mono or Stereo Mix).


    To initiate the recording, go to Capture > Capture video (or press F6 or F7). You can also set hotkey in Capture > Preferences > Hotkey. The recording will automatically stop if you run out of space (or if you hit your file system file limitation [e.g the 4 GB limit in a FAT32 disk]).

    Play your game or replay then, voil, you got your avi file !


    2. Compressing the AVI
    Of course, you'll want something lighter than a multi-gigabyte file. We'll compress it into something more web-worthy.

    Video compression is a recurring problem in the computer world and is often confusing with all those codec thing thing. We'll use the VirtualDub and ffdshow tryout, which serves both as a compressor and a decoder.

    If this isn't already done, install ffdshow tryout*. Then, launch VirtalDub (or exit the capture mode) and open your file. You will see your video in two seemingly identical panel. There's a timeline at the bottom. You can play or pause with the usual button. You can select a prise frame of the video with the arrows keys. The last two buttons define which part of the video you want VirtualDub to process. If there's something you don't want in your video (mouse trails, etc...), use them.


    When you're finished with this, go to Video > Compression. Then, select ffdshow video compression, click configure and don't panic.


    In Encoder, chose Xvid (H.263 may had better result, and HuffYUV is the one you'll want if you want a lossless pixelperfect but huge video file). In mode, chose One Pass - Quality. You can now chose an human comprehensible quality. The bigger the number the better it is, but you'll get also bigger files. I use 85. Don't touch anything else unless you know what to do.


    Now, there is something else you'll want to compress, and that is the audio. Make sur Audio > Full Processing mode is enabled, then go to audio > Conversion. Set the the sampling rate to 44100 Hz, then go to Audio > Compression, and chose Lame MP3. If you don't have it, install those two things [LAME MP3 Encoder], [LAME DirectShow Filter]. Now, a bitrate in the 44100 Hz range (something low, between 128 and 96 kbps... you don't need a perfect sound quality for Tetris anyway).


    Finally, start the compression in File -> Save as Avi (or press F7). You'll get a much lighter file.


    I suggest you to watch it to check if there aren't any anomalies (garbled audio or out of sync, weird colors etc..)

    3. Shiny addendum
    You can also add shiny decoration, like fading avatar and player's name using VirtualDub Logo filter.

    To use it, open Video > Filter, then Add > Logo (by Donald Graft). You'll get to a window like this.


    In input file, you'll need to give the path to a bmp file. Animation other than fade in/out is made by making a series of pictures with a <number>.bmp name (e.g. 001.bmp, 002.bmp, 003.bmp, 004.bmp, ).

    You can select an overall opacity in the Opacity > Alpha areae, or set a particular color to be transparent in the Masking area.

    Preview is very useful to determine when and where your bitmap must appear.

    Additionnaly, for the fade in/out effect:

    Starting frame: indicates when the logo must appear
    Fade In Len: indicates how long must it take to appear on screen
    Out End: indicates when the logo must disappear
    Fade Out Len: indicates how long must it take to disappear on screen

    Now press Ok and normally save/encode your video.

    * ffdshow tryout bonus: and with Media Player Classic Home Cinema, you can get one of the best media player around. It can read just *anything*, exept .mov and .rm files.
  2. Amnesia

    Amnesia Piece of Cake

    Excellent, I will really take a moment to do an attempt with Heboris for example..
    I am sure I will have some problems, don't know why..Just a feeling.. [​IMG]
  3. Very nice. I will definitely try it out.
  4. nice guide, thanks alot.
  5. Jan


    Thank you for the tutorial!

    I have a problem with the compressing. When I try to save the avi file it says "Unable to initialize the output codec. Check that the video codec is compatible with the output video frame size and that the settings are correct, or try a different one." It only happens when I crop the unwanted area, otherwise it works.
  6. The width and height value must be a multiple of 2, I think.
  7. Jan


    Yes, now it works. Thanks.
  8. tepples

    tepples Lockjaw developer

    This will probably suck if your computer has AGP video because AGP's channel from VRAM to main RAM isn't fast enough. It's fine for teaching people how to use a business app but not for games. You'll need PCI Express for any attempt at a decent frame rate. (I haven't tried integrated video, so I can't speak for that.)

    But if your PC has TV output, of course, you can use a Neuros OSD, an Aiptek camcorder, a DVD recorder, or anything else that can record video to a file. For this, I recommend running Lockjaw in a full screen.

    Or you can just play Lockjaw for GBA and use VisualBoyAdvance to capture to AVI. But if you go this route, make sure to adjust the video's frame rate to match the audio because VBA writes a slightly too large frame rate to the AVI header.
  9. Muf


    Two words: quicktimealt and realalt [​IMG]
  10. If anyone runs into the same problem as I had, I'll share the solution.

    I used VirtualDub with the UScreenCapture like this tutorial is about (by the way: thanks alot, PetitPrince). And the video codec was ffdshow with HuffYUV selected within it. Then just the ordinary raw PCM sound with the soundcard's Master as input so it'd record the game's sounds... Well the problem was that after a while, the sound in the outputted video lagged.. So it became a horrible seconds-long lag between the sound and video... But I found a solution.

    In VirtualDub, go to "Capture" -> "Timing..." In the dialog there, change "Resync mode" to the middle one ("...adjusting video timing"), instead of the the last one ("...resampling the audio...") that is selected as the standard setting. I also changed "Audio latency determination" to "Fixed" and "-50" in the box there. This is because the sound would still lag a little. I don't know if the lag is exactly 50 ms, but it made it feel synced for me.

    That solved my problem. Hope that helps someone...
  11. lmao i had the same problem.

    and i fixed it in the same way, minus the 50ms thing.

    also remember to hit F6 instead of f5 when you record.
  12. What's the difference? They are both linked to the same selection in the Menu, it says "Capture video F5, F6".

  13. f5 is the default capture mode

    f6 will apply some extra features (such as syncing between audio/video for instance)
  14. Ai


    I have trouble recording .avi files in Texmaster in the last version. When I go to the replay menu and select a game to be recorded, it just runs the replay instead of giving me the choice to select a video compression codec. Does anyone else have this problem?

    Also I'm wondering if some can name another capture program besides UScreenCapture that's good and easy to use.

    Finallly how can I speed up or slow down games as done by LOst in this video.

    Thanks in advance for any help! ^^


    The reason why I'm looking for a new capture program is that whatever I do (and I tried Meroigo's tips) sound and video isn't synced in the recorded videos. It works fine for a while, but it always starts lagging or getting out of sync short afterwards. I never had this problem recording from Texmaster. I'll give the other capture programs mentioned in this thread a try and see if I can get it working again.
    Last edited: 22 Sep 2009
  15. flavioscorpion

    flavioscorpion Unregistered

    thanks!!! is the best screen recorder
  16. So interesting,but i prefer use Screen VidShot.It's prog can record screen video and audio)

Share This Page