anu2702
anu2702

Reputation: 358

Can Video capture in windows media foundation used for screen capturing?

can desktop screen be captured using Video capture in windows media foundation.
After reading windows developer guide, it seems it is used for capturing video from devices such camera or other external devices.
If yes, is it hardware accelerated API or software base?

Upvotes: 0

Views: 2595

Answers (2)

Rudolfs Bundulis
Rudolfs Bundulis

Reputation: 11934

For desktop screen capture you should look at the output duplication feature implemented through IDXGIOutputDuplication. What you do is obtain the DXGI object for the video adapter you need, enumerate the outputs to find the needed one (or all if you do a simultaneous capture from multiple screens) and duplicate it through a call to IDXGIOutput1::DuplicateOutput. The duplication gives you access to the GPU video surface that can be mapped to CPU readable memory - so yes it is accelerated.

Here is a complete sample from Microsoft on this matter.

Upvotes: 4

Evgeny Pereguda
Evgeny Pereguda

Reputation: 583

I see that you need resolve very specific task and I think that there is a solution which is very close to your needs. On site "CodeProject" there is article "CaptureManager SDK". It includes interesting example code for streaming desktop screen and output speaker buffer by Media Foundation. It can stream to web browser by MP4 format. I think you can find it interesting.

Upvotes: 0

Related Questions