VHScrCap bugs

Many months ago, I found an incredibly annoying bug in a DirectShow filter/capture driver called VHScrCap, both in the older 1.x versions, as well as the newer 2.x versions.

Before I go into the bug, I’ll explain what VHScrCap is and what purpose it serves. It’s a very popular application used for capturing portions of one’s desktop (or any application window) and retransmitting it to any WDM-compliant (thus DirectShow) capturing application. For example, if you’re on Windows Live Messenger and want to show your friend a portion of your Firefox window, you can use VHScrCap for that purpose. The VHScrCap driver shows up as a webcam device in applications which support DirectShow — including Adobe Flash. VHScrCap is also quite fast, including some optimisation features which make it significantly fast even with large regions (1920×1200 for example).

For a few years I’d been using VHScrCap for one purpose: capturing the video portion of a Windows Media Player or Media Player Classic window, and re-streaming the video to a friend of mine in Michigan via Ustream. We watch bi-weekly episodes of Game Center CX, the Angry Video Game Nerd, island survival adventures involving members of Yoiko, or even us playing video games. Ustream uses Adobe Flash as a client (on both the sender and receiver side).

The bug was simple to reproduce: launch Ustream, launch VHScrCap’s configuration utility, set things up, and stream something as usual. Once finished, exit the browser, then go through the same routine again. The capture region/aspect ratio was completely wrong, and in some cases the capture region was capturing something like an 8×8 pixel region on my screen (and was heavily blurred at that!). I’ll add that the issue was not specific to Ustream: I could use Windows Live Messenger, or any DirectShow-friendly application to reproduce the bug.

I found that deleting the registry key HKLM\Software\HmelyoffLabs\VHScrCap before launching Ustream would fix the problem every time. Actually, to be more specific, deleting HKLM\Software\HmelyoffLabs\VHScrCap\params is what would fix it. I ended up writing a batch file and a replacement .reg file to work around the problem. See below for the link to those.

In December I contacted VHScrCap’s author and informed him of said bug, attaching screenshots of the problem. At first the author blamed Adobe Flash for the problem, and insisted I send him mini memory dumps when the problem happened (which required me to install extra Microsoft software). So I did. Then the author insisted there were no bugs in his code, and asked me to capture video of said problem. So I did. The author continued to blame Adobe Flash for something that is quite specific to his driver. I offered to completely format and reinstall Windows XP on my workstation as a form of troubleshooting — it made no difference. I eventually gave up communicating with the author, as it became obvious from the tone of his mails that he had zero interest in fixing this bug.

In case you want the workaround batch + .reg file, or to see the videos of the problem, they’re available below. Keep in mind that the .reg file is specific to VHScrCap 2.1.2 and will not work with earlier versions or later versions.

And then something happened yesterday…

I came across a Japanese application called SCFH DSF (which is a DirectShow Filter version of the SCFH program). You see, a few months back, the same friend and I translated SCFH and made an English version of the binary for personal use (I can’t/won’t post it out of respect for the author — I need to get in contact with him so there can be an official English release!). But a few weeks ago, the author released a DirectShow Filter version of his program, which means it more or less does the same thing VHScrCap does!

I promptly uninstalled VHScrCap and installed SCFH DSF. The client is in Japanese (I’m working on an English version), but it works wonderfully. Does it have the same bug as VHScrCap? Nope! Which further proves that the problem is with VHScrCap…

So for any visitors which use VHScrCap, reconsider using a DirectShow filter that actually works. :-)