Video grabbing

Reference material

Some factoids...

VHS tapes have a maximum resolution of about 300-320 pixels per row, ard rows are interlaced: use no more than 352 x 576 pixel resolution.

Standard TV (PAL) resolution is 720 x 576 pixels.

Codec: use DivX codec. It's free for personal use, it has a fair compression ratio, it's well documented.

An optimal bitrate is about 192KBps

A rough estimate: 1 hr video → about 12.5 GB

Video acquisition procedure

Hardware:

  • A standard VHS VCR
  • Terratec Grabby video to USB converter
  • A Windows XP Professional laptop, 1 GB RAM, ~50 GB free disk space, AMD CPU
Software:
  • VirtualDub, plus:
    • K-Lite Mega Codec Pack
    • Add Frame Numbers filter
    • add the filter used for overlay
  • A bitmap editor (GIMP, for example)
  • add something to burn DVDs (CdBurner XP?)

Detailed procedure

Acquire:
  1. Start Virtual Dub.
  2. Place VirtualDub into Capture mode by clicking "File→Capture AVI"
  3. Choose a file where the captured stream will be saved clicking "File→Set Capture file"
  4. Click "Video→Compression" to select a video codec:
  5. Once the "Select video compression" panel appears, choose ffdshow from the codec list.
  6. Click the "Configure" button and set up ffdshow as follows:
    • encoder: MPEG-4
    • FOURCC type: XVID
    • encoder type: two passes, 1st pass
    • in "Generic" panel set Grayscale on (for the curious, I'm recording black and white images fron an infrared camera)
    • Leave other ffdshow parameters as default, click "OK" where necessary, go back to VirtualDub Capture mode interface
  7. Add some filters, e.g. to have the video properly timestamped: click on "Video→Filter chain", ensure that there is a tickmark besides "Enable"
  8. With the filter chain enabled, place some filter in tha chain: click "Video→Filter chain→Filter list" to access the filter chain panel.
  9. Click "Add" button, choose "Add FrameNumber/Add Timestamp" filter, and configure as follows:
    1. In column: choose "None"
    2. Out column: choose "Timestamp"
    3. Colour column: leave as is, i.e. green text, no background
    4. General settings: leave as is, i.e. "Automatic frame position" is the only options ticked, "Font size" cursor is at 100%
    5. In the "Optional settings" section, fill in the "Out" row with the correct date (i.e. when the tape you' re converting has been actually recorded), then choose the "yyyy.mm.dd" date format
    6. Last, in the "Show frame #" section, tick the "Out" box. Leave coordinates as they are.
  10. Add also "2:1 reduction, high quality" filter, set this one as first in the filter toolchain
  11. Add a "resize" filter, setting it as follows:
    • New size: absolute pixels, 428x321
    • Aspect ratio: same as source
    • Filter mode: precise bicubic A=-0.60
    • Framing options: do not letterbox or crop
    • Codec friendly: multiples of 2 (the ffdshow codec wants frames with sizes that are multiples of 2)
  12. Click all the "OK" buttons you need to go back to the "Video Capture" main screen.
  13. Configure how to preview video while capturing: click "Video", ensure that "Preview" is ticked.
  14. Next, click "Video→Preview acceleration" and choose "Interlaced - Frames". Now yoy should see some green numbers on screen bottom.
  15. Give VirtualDub a time limit, to let it go unattended while capturing: click "Capture→Stop conditions" and specify, say, 144400 seconds (that is, the full length of an E240 VHS tape, i.e. 4 hours)
  16. Now all should be ready to capture video: press "Play" (or whatever) on the VCR, and quickly press the F5 key (Capture Start). Do something else for the next four hours (duh!)

The following procedures have been souped up gathering informations here and there from the web.

Procedure 0

I'm trying to achieve best compression and medium quality, starting from Procedure 2 ideas, thus:

Procedure 1

Acquire and deinterlace.

As from divx-digest.com:

  • acquire at 512 x 384 at 29.967 fps
  • deinterlace

Procedure 2

Acquire, resize, inverse telecine.

  • capture at 352x480 (or 512 x 384) at 29.967fps, to get both fields (VHS is interlaced), use VirtualDub or freeVCR [add URLs]
  • load captured file in VirtualDub, apply a resize filter (to 352x240, use the "precise bicubic" option)
  • (optional, check whether saves space, should go for grabbed films, not sure it actually gives any advantage for home-made VHS) in VirtualDub, go to "Video/Frame rate", look for the "Inverse telecine" box and choose "Reconstruct from fields - adaptive". Do not change the frame rate (29.967), it will be changed automatically.
  • Compress using DivX low motion @ 800 kb/sec (this fits 2 hours of video on a standard CDROM)
  • Audio (if any): use MPEG layer 3; set "Audio/Full processing mode" and in "Audio/Interleaving" set "Interleave audio every" to 30 frames.


TODO: set up something to acquire as follows:

  • 352 x 576 resolution
  • DivX codec
  • 192 KBps variable bitrate
  • as compressed as possible, maybe lossless...