WMV文件中的C#抓帧 [英] C# Grab frame from wmv file

查看:89
本文介绍了WMV文件中的C#抓帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道是否可以使用C#在不安装DirectX且不能在Windows 2008上工作的情况下使用C#在位置X的视频(.wmv)中捕获帧/图像(我想安装的网络服务器越少越好).

Does anyone know if it is possible to grab a frame/image from a video (.wmv) on position X using C# without installing DirectX and working on Windows 2008 (a webserver I would like to install as less as possible).

甚至使用DirectX的简单解决方案也可能很好.

Or even a simple solution with directx could be nice.

Henk

推荐答案

您真正需要研究的是 Media Foundation .根据我的阅读,它是一个更好的库(DirectShow对于复杂的任务来说是地狱),但是不幸的是,由于缺乏对XP和更早版本的支持,目前仅以Media Foundation为目标并不是切实可行的.

What you'll actually need to look into is DirectShow, the general-purpose media (both audio and video) library for Windows. It used to be part of DirectX but several years ago it branched off and became part of the Windows (Platform) SDK. I should also point out here that it's now been deprecated since Windows Vista in favour of Media Foundation. From what I've read it's a much better library (DirectShow is hell for complex tasks), but unfortunately it's not really feasible to only target Media Foundation at the moment because of the lack of support for XP and earlier...

我能做的最好的事情就是将您指向 DirectShow.NET ,它是DirectShow的.NET包装库. ,它目前相当稳定且经过了良好的测试.它包括各种示例,这些示例应该可以帮助您入门,但是决不是一个简单的解决方案.另外,我强烈建议您查看此CodeProject文章/示例应用程序.它既处理网络摄像头视频捕获,又处理文件(包括WMV)中的视频回放.进行一些尝试,学习如何进行帧搜索/单帧捕获(我认为项目可能甚至有一些代码可以做到这一点)应该可以满足您的需求.也许您甚至可以在该CodeProject应用程序的DirectShow.NET示例中找到精确的解决方案.

The best I can really do is point you to DirectShow.NET, a .NET wrapper library for DirectShow, which is rather stable and well tested at the moment. It includes various samples which should help you get going, but by no means will it be a straightforward solution. Also, I strongly recommend you take a look at this CodeProject article/sample application. It deals with both webcam video capture and video playback from files (including WMV). A bit of playing around with that, and learning how to do frame seeking/single frame capture (I think that project might even some code to do that) should get you what you need. Perhaps you'll even find the precise solution somewhere within the DirectShow.NET samples of that CodeProject app.

当然,如果可以的话,我会建议一个更简单的解决方案,但目前您对DirectShow的可怕性感到非常困惑.无论如何,祝你好运!

Of course, I would suggest an easier solution if I could here, but you're pretty much stuck with the horribleness that is DirectShow for the moment. Good luck anyway!

这篇关于WMV文件中的C#抓帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆