ISampleGrabber 已弃用?
我有一个旧的计算机视觉实验,它使用 Video for Windows 从连接到 PC 的相机中抓取帧。这是一个 hack,它使用 VfW 创建一个预览窗口,然后从窗口 DC 执行 GetDIBits。
我终于准备好将其移植到 DirectShow 了。我的理解是,我可以使用 ISampleGrabber 从视频捕获图中抓取帧,但现在我读到ISampleGrabber 已弃用。
从视频源中抓取帧的未弃用方法是什么?我是否必须实现自己的 DirectShow 过滤器,该过滤器的作用基本上与 ISampleGrabber 的作用相同?
I have an old computer vision experiment that uses Video for Windows to grab frames from a camera connected to the PC. It's a hack, it uses VfW to create a preview window, then it does a GetDIBits from the window DC.
I'm finally ready to port this to DirectShow. My understanding was that I could grab frames from a video capture graph by using ISampleGrabber, but now I read that ISampleGrabber is deprecated.
What's the non-deprecated way to grab frames from a video feed? Do I have to implement my own DirectShow filter that does essentially what ISampleGrabber does?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DirectShow 并未被弃用;只是 DirectShow 编辑服务。我强烈建议使用 DirectShow,因为它支持更广泛的级别,除非需要 MF 的特定功能。
DES 已经有很多年没有发展了,但是样本采集器是一种广泛使用的过滤器,在某种程度上独立于 DES。我很乐意推荐您使用它。如果 Windows 的未来版本出现问题,更换过滤器不会超过一两天的时间。
G
DirectShow is not deprecated; just the DirectShow Editing Services. I would strongly recommend using DirectShow because of the much wider level of support, unless there are specific features of MF that are needed.
There's been no development of DES for some years, but the sample grabber is a widely-used filter that is somewhat independent of DES. I would be happy to recommend that you use it. If there is an issue in future versions of windows, it would not be more than a day or two's work to replace the filter.
G
我认为 Windows Media Foundation 会如果您只针对 Vista/Win7,这是您最好的选择,否则您仍然可以使用 DirectShow/SampleGrabber 方法,我怀疑它会很快被删除。相关问题此处。
I think Windows Media Foundation would be your best bet if you are only targeting Vista/Win7, otherwise you can still use DirectShow/SampleGrabber approach, I doubt it will be removed any time soon. Related question here.