简体   繁体   中英

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM