@bobfrankston/vhscap
v0.1.1
Published
Capture VHS/composite video from a DirectShow device with ffmpeg, with a live preview window that never aborts the recording
Maintainers
Readme
vhscap
Record from a DirectShow capture device (a generic USB VHS/composite dongle) with ffmpeg, showing a live preview window while it records.
Install
npm install -g @bobfrankston/vhscapWindows-only (DirectShow). Requires ffmpeg + ffplay on PATH and Node 25+.
This ffmpeg build has no SDL output device, so ffmpeg can't open its own preview window. vhscap has ffmpeg write the recording file and pipe a second low-latency stream (intra-only mpeg2, no encoder lookahead lag) which the script forwards to an ffplay window. Because the script does the forwarding, closing the preview window does not stop the recording.
Usage
vhscap -list list video/audio capture devices
vhscap -modes [-video "name"] list a device's supported resolutions/framerates
vhscap [options] record — press q in the console to stopOptions:
| Flag | Meaning |
|------|---------|
| -video "name" | video device (auto-picked when only one real device exists; OBS Virtual Camera is ignored) |
| -audio "name" | audio device, or -audio none. Default: the audio device on the same physical USB device as the video device (paired via Windows PnP vid/pid), falling back to name matching (e.g. "AV TO USB2.0" / "Line (AV TO USB2.0)"). If no single device pairs, vhscap lists them and asks for -audio. |
| -size WxH | force capture resolution (default: device native) |
| -fps n | force framerate (default: device native) |
| -out file | output file (default vhs-YYYYMMDD-HHMMSS.mkv) |
| -crf n | x264 quality, lower = better (default 18, visually lossless for VHS) |
| -nopreview | record without the preview window |
Typical session:
vhscap -list
vhscap -modes -video "USB Video"
vhscap -video "USB Video" -audio "Line (USB Audio Device)"Notes on VHS resolution
There is no 480x320 mode — NTSC composite capture is delivered at 720x480 (or 640x480)
at 29.97 fps interlaced, and that's the native mode generic dongles expose. VHS tape itself
only resolves ~240 luma lines horizontally, but you still capture at 720x480 because that's
what the digitizer emits; downscaling would discard information. Leave -size unset to get
the device's native mode; use -modes to see what the dongle actually offers.
The recording is kept as the dongle delivers it (interlaced). If you later want a
deinterlaced copy for viewing: ffmpeg -i in.mkv -vf yadif out.mp4.
Development
Source is vhscap.ts, compiled in place by tsc (co-located .js/.d.ts/.map).
Publish with npmglobalize.
