windows 如何从视频中提取帧(使用 DirectShow)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/634502/
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
How can I extract frames from videos (using DirectShow)?
提问by George
I have to extract the frames from any video file that can be played using the standard windows media player into separate images. Can you provide me some info on how to proceed, what documentation/books to read, etc?
我必须从可以使用标准 windows 媒体播放器播放的任何视频文件中提取帧到单独的图像中。你能给我提供一些关于如何进行、阅读哪些文档/书籍等的信息吗?
The language is C/C++.
语言是C/C++。
Also, don't recommend any solution which involves GPL code, the software I have to work on is proprietary.
另外,不要推荐任何涉及 GPL 代码的解决方案,我必须使用的软件是专有的。
回答by Dani van der Meer
I can recommend you the following excellent example on CodeProject. It shows you how to process frames from a camera source or an avi file.
我可以向您推荐以下关于CodeProject 的优秀示例。它向您展示了如何处理来自相机源或 avi 文件的帧。
回答by Quassnoi
You may just add a SampleGrabber
filter to your graph, and save the images to the disk in a callback function as they pass down the graph.
您可以只SampleGrabber
在图形中添加一个过滤器,并在图像传递到图形时通过回调函数将图像保存到磁盘。