Log in

View Full Version : Capturing game footage more efficiently with Intel's Quick Sync


whiplash000
8th October 2012, 21:42
EDIT: Seems there's a company out there that's finally made a screen recorder that uses Quick Sync. It's called 'Action!'.





My system:
Windows 7 x64
i7 2600k @ 4.4ghz
ASRock Z68 Extreme4
2x 5850 CF
12GB RAM

Lucid Virtu 1.2.113
Windows 8 RC x64 on VMWare (Development box)

I'm trying various experiments on taking advantage of Intel's Quick Sync technology in order to capture video with as little of an impact on in-game fps as possible. I record at 1920x1200 at 60fps. My goal is to write a VFW codec for Dxtory that compresses to H.264 (possibly other formats, too) utilizing Quick Sync's hardware acceleration.

But before I do that, I need to check that this is not a waste of my time by testing the technology's efficiency through things that have already been made. Namely, by using the Directshow samples included with the Intel Media SDK r3, and GraphStudio. Dxtory includes a nice DirectShow Output feature that makes it easy to set up a graph. I did: Dxtory Video 1 -> Intel Media SDK H.264 Encoder -> Matroska Muxer -> out.mkv. Now, you might notice I didn't do the audio, compared to video bitrates, audio is trivial.

Lessons learned building the Intel Media SDK DirectShow sample code:
- Use Visual Studio 2010, NOT 2012
- Install the Windows SDK and Visual Studio BEFORE installing the Intel Media SDK
- RTFM
I just saved someone a few hours of frustration right there :P

I use Lucid Virtu to allow arbitrary programs to utilize my CPU's built-in graphics instead of my dedicated card, which is necessary in order to do Quick Sync. I first tested this setup by using the Intel Media SDK's sample_encode sample program. I ran it with default settings (software encoding), then ran it with the -hw flag (hardware encoding). I noticed a pretty good speed boost, didn't get it into numbers, but it was enough to know it worked. I temporarily disabled the program from using the integrated graphics in Virtu and when I ran the program with -hw once again, it errored out because it couldn't detect my integrated GPU. Good.

The game I used to test is Battlefield 3. Normally, I get around 70-90fps. When I start streaming using Dxtory, the fps stays roughly the same. But when I start the graph in GraphStudio, I drop down to about 30-50fps. Crap. But the quality is quite decent!


So there's my problem: it doesn't seem to be using hardware acceleration, even though I added graphstudio.exe to Lucid Virtu's list. I added Dxtory for good measure and tried searching for another executable to add to the list, but it didn't help. I'm not getting any better speed then when I was using the VFW codecs already available.

I tried forcing HWA by changing this piece of initialization code in \samples\sample_dshow_plugin\common\src\base_encoder.cpp, line 37:
sts = SetAcceleration(MFX_IMPL_AUTO_ANY);
to
sts = SetAcceleration(MFX_IMPL_HARDWARE_ANY);
but when I did, the filter wouldn't even work anymore. It must've run into an initialization error of some kind.

How do I get this filter to cooperate with Lucid Virtu?