windows DirectShow - 获取视频帧
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8039809/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
DirectShow - Getting video frames
提问by Matt Kline
I'm creating a Windows video capture application and am using DirectShow for capture. As each frame comes in, I want to grab it as a raw RGB bitmap into a buffer, at which point my code will do whatever processing I need.
我正在创建一个 Windows 视频捕获应用程序并使用 DirectShow 进行捕获。当每一帧进来时,我想将它作为原始 RGB 位图抓取到缓冲区中,此时我的代码将执行我需要的任何处理。
I've been searching for samples similar to what I want to do, and everywhere I look online, people recommend using either the IMediaDetand/or the ISampleGrabberinterface to do frame-by-frame capture. Unfortunately, both are deprecated and aren't even in the newest version of the Windows SDK.
我一直在寻找与我想做的事情类似的样本,无论我在网上查看的任何地方,人们都建议使用IMediaDet和/或ISampleGrabber接口进行逐帧捕获。不幸的是,两者都已弃用,甚至不在最新版本的 Windows SDK 中。
What is the best (modern) way to do frame-by-frame capture in DirectShow? If there is none, is there a different library I should use that will give me frame-by-frame capture?
在 DirectShow 中进行逐帧捕获的最佳(现代)方法是什么?如果没有,我应该使用不同的库来逐帧捕获吗?
采纳答案by Roman R.
Sample Grabber
was deprecated a few years ago, which was a few years after DirectShow development actually stopped. That is, use Sample Grabber
as you read as suggested method and it is going to work great for you.
Sample Grabber
几年前就被弃用了,那是在 DirectShow 开发实际上停止的几年之后。也就是说,Sample Grabber
按照建议的方法在阅读时使用,它对您很有用。
The only thing you will additionally need is to copy definitions int your source code, see details:
您还需要做的唯一一件事是将定义复制到您的源代码中,请参阅详细信息: