1

I'm working on a C++ project that requires a low latency video stream from one machine to another. Bandwidth isn't an issue, so they can be sent over uncompressed.

I've looked around and found lots of answers that require DirectX, but from what I've read that solution is CPU intensive. I plan on playing video games and such on the machine that'll have this screen capture going on so I want to minimize CPU usage.

Does anyone know any libraries that can do this with low latency, like under 2 ms per frame?

0

Any solution that involves capturing the screen and streaming it through network is bound to be processor-intensive. However, if your hardware is powerful enough, you could get satisfactory performance. The company I work for has a screen capture video source and a multimedia toolkit with C++ demos for capturing, streaming and playback.

If you would like to try, download the free evaluation edition from our website and check out the C++ demos for the Capture module and the streaming module.

The evaluation is fully-functional (but time-limited) and comes with unlimited free technical support through email and chat. This means if you need help modifying the demos to do what you want, send us the full details and our engineers will work with you to see if it’s possible to do and how.

Update in response to comment:

I experimented a bit on a test PC here (Core i7-870, about 8 years old) and tried both uncompressed and compressed full-screen capture (1680x1050 resolution) at 2 capture rates (15 and 30 frames per second). Here are the results I got: Results table

In some cases, using compression increased CPU usage, but in others, it actually reduced it, probably because the smaller data size reduced copying load off of the CPU.

Also, using compression almost always improves effective frame rate.

Other compressors, such as H264, might require more processing power, but again they can make use of the GPU.

I expect you will get better results if you use better hardware, that’s why I recommended trying the free evaluation in your actual environment.

  • Will high CPU utilization remain high if there isn't any video compression? I was under the impression that not compressing the video would leave CPU utilization relatively untouched – Adi Y Feb 9 at 1:31
  • Compression can actually reduce CPU utilization due to having less data to copy. See update in my answer for more details. – Amin Dodin Feb 10 at 18:38
  • Wow that's interesting. I didn't think about the intensity of copying a video stream. I'll look into it more, but thanks for doing that experiment! – Adi Y Feb 11 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.