• Published on | Mar 01, 2015 | by Chris Osborn

Processing Digital Video and Digitizing VHS

As I’m continuing to build a collection of cartoons, TV shows, and movies on my plex server, I’ve put together several scripts to make converting and splitting video easier. For the most part though I’ve been working with digital copies of things. While I have been working on digitizing old home movies shot on 8mm video tape, I’ve been using a digital 8 camcorder which has a FireWire interface and handles the digitization, so on the computer I’m working with digital video. I’ve also fully automated the transfer of 8mm tapes: my script rewinds the tape, starts the capture, rewinds the tape at the end, converts to x264 and deinterlaces, and then finally uploads the mp4 to my server which uses BitTorrent sync to send the video to my mom.

Dealing with analog video like VHS has been much more difficult. I’ve got a pretty large collection of older video capture hardware so I refuse to go out and spend money buying more, and it's not like buying newer capture hardware is going to improve the quality of a VHS tape. The Core 2 Quad computer that I’m using for working with the 8mm video happens to have a ViXS PureTV-U 48B0 capture card in it, and I’ve spent quite a lot of time trying to make that work. It seems though that it will only work with Windows Media Center and not much else. I can get some software to capture video, but not audio. Something to do with crossbar support. And of course the card is so proprietary there’s no support at all for it under Linux.

Another attempt to digitize the video was by using a MiniDV camcorder that has a passthrough option to convert analog to digital. This probably would have worked just fine, but as it turns out the camera is broken and there is barely any audio on the left channel. There must be something wrong with the A2D chip, because it does the same thing with the built-in microphone and a very old video recorded with the camera had the same problem.

The next thing I tried was a KWorld HD 330 USB stick. Both audio and video are seen by the software that came with it, but when I tried doing a few recordings the audio kept clicking every half second or so. Linux v4l2 can also see it, but under Linux I could never get anything I tried to recognize there was an audio channel.

A few years ago I picked up some cheap “EasyCap” USB things for my security camera. EasyCap isn’t a brand name though, it’s a generic Chinese term for a USB capture device, which means you never know what kind of chip or hardware is actually in them. While they have worked well enough on my Windows XP computer for the security cameras, I couldn’t get them to work on Windows 7 or Linux at all.

But wait, I'm not out of devices yet! I also have a KWorld 120 PCI card! It also had drivers and was automatically detected in Linux, but again, I couldn’t get the audio to work.

Finally giving up on ever getting the audio to work through one of my TV cards, I resorted to hooking the audio to the line-in on the sound card. At last, I can record! However the audio level was *extremely* loud, and I double checked several times that I was plugging into the line-in on the card and not the mic in. I ended up getting out a Radio Shack audio mixer and using it to adjust the volume.

Recording with the app in Windows was nice because I could monitor what was being recorded live, but using Windows makes it very hard for me to automate. Most of the articles I found on the internet talking about recording on Linux were using ffmpeg, which works, but doesn’t allow you to monitor what’s going on. After a whole lot of trial and error I was finally able to get VLC to display the video and save it to a file too.

Ideally I’d like to be able to monitor the VCR and tell it to seek to a certain position, stop when I’m done recording, and know when it’s hit the end of a tape. I have an old GoVideo Montage dual deck VCR that has a serial port, but the VCR no longer works. Even after replacing the worn out belts, it just says “Error” on the display when I try to do anything besides eject a tape.

The Mitsubishi HS-U778 S-VHS VCR that I picked up at Goodwill for $6 has ports on the back labeled “Active A/V Network.” They’re not really active at all, they’re just a wired infrared remote pass through. The VCR doesn’t send any signals to indicate its state over the wired bus. All I really need to do is be able to read the state of the VCR from the display, for control I can send remote control signals, either as IR or through the wired interface. But without the feedback it would be impossible to seek. I did get hold of a service manual which includes schematics and I see that there’s an I2C bus internally, but I haven’t yet had a chance to try to interface to it.

It would sure be nice to be able to automatically seek the VCR to a point every 10 minutes, record a minute of video, and assemble it into a preview so I can see if the tape is even worth digitizing. But I don't have very many VHS tapes (yet) so I will probably end up doing it manually.

If you want to use my scripts to digitize analog video or rip DVDs or do other processing, you can download them from github here.

Join The Discussion

+1  Posted by Asterisk • Mar.12.2015 at 13.52 • Reply

If your video capture hardware presents a VfW or WDM interface, you can probably automate it using VirtualDub (http://www.virtualdub.org) -- it's an excellent, open-source video processing tool for Windows, and it has both a command-line version and a scriptable GUI version. You can use it in conjunction with AviSynth (https://en.wikipedia.org/wiki/AviSynth) to do additional post-processing, and EventGhost (http://www.eventghost.org/) to interface with whatever solution you end up using to control the VCR remotely. You'll end up with a bit of a duct-tape-and-bubble-gum solution, but it will work.

Monitoring the state of the VCR might be a bit of a challenge, as you described, but if the entire capture process is fairly well automated, and you can just pop in a tape and come back a couple of hours later to a completed video file, it might not be worthwhile to bother with inspecting the videos in advance to determine which ones are worth capturing -- just capture them all and decide which files to keep afterwards.

I digitized a collection of old VHS home movies a couple of years ago, using a similar process: I used commodity capture hardware (an older Hauppauge card with a Brooktree chip) on a Windows box to grab raw video with VirtualDub, saving the resulting files at 720x480, 29.97 fps, using the lossless Huffyuv codec for archival purposes. Then, again using AviSynth and VirtualDub, I deinterlaced, aspect corrected, and re-encoded these into 640x480 h.264 files, and also ran the audio through some filters in Audacity to improve audio quality before remuxing them.

+1  Posted by Chris Osborn • Mar.12.2015 at 13.58 • Reply

VirtualDub was completely useless. It couldn't see any hardware at all, just gave me a big blank window.

I do agree that capturing the entire tape is probably the way to go. The problem is that I want to stop when I hit the end of the tape, and the length of tapes varies depending on what mixture of EP & SP speeds were used.

+1  Posted by Asterisk • Mar.12.2015 at 14.29 • Reply

If you were able to capture the video with VLC, then you should be able to get it to work in VirtualDub, as VLC is looking for the same DirectShow or VfW devices that VirtualDub does. VirtualDub might default to a disconnected state, though -- there's likely only a problem if your capture device isn't enumerated in the 'Device' menu. VLC can, of course, also be controlled on the command line, and you can then script VirtualDub to post-process the files captured by VLC.

If you're capturing into a compressed format, and you've got plenty of disk space, it probably isn't that big a deal if you're capturing beyond the tape stopping -- the blank video stream will compress pretty thoroughly, and you can define an auto-stop condition in VirtualDub according to capture file size.

OTOH, it looks like the "end sensor" described in your VCR's service manual is just a phototransistor. Assuming that this is what triggers the tape stopping when it reaches the end, you might be able to just piggyback on it to end the video capture via a Teensy or something similar.

+1  Posted by Chris Osborn • Mar.12.2015 at 14.35 • Reply

I was never able to get VLC to work right under Windoze, and really have no interest in trying to use Windoze for capturing anyway. I've been doing everything under Linux. I ended up giving up on using the capture cards and VLC anyway, because the audio would get more and more out of sync the longer I recorded. I've resorted to using another Sony camcorder with only composite passthrough to do capturing.