从视频文件到图片框获取帧 [英] Get frames from video file to picturebox

查看:82
本文介绍了从视频文件到图片框获取帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊重所有人,



我想从.mp4文件到图片框中获取帧我怎么做?

我可以使用Windows媒体播放器得到帧?否则哪个播放器适合播放视频和获取帧。



提前谢谢。

Respected all,

I want to get frames from .mp4 file to picture box how i can do it?
Can i got frames using windows media player? Otherwise which player is suitable for play video and get frames.

Thanks in advance.

推荐答案

你不需要球员。您需要编解码器或类似软件。此外, PictureBox 完全无关紧要。您只需要从视频中创建一些位图。



我建议使用开源库或实用程序FFmpeg或libavcodec: http://en.wikipedia.org/wiki/Ffmpeg [ ^ ],

http://ffmpeg.org/ [ ^ ],

http://en.wikipedia.org/wiki/Libavcodec [ ^ ],

http://libav.org/ [ ^ ]。



这是最好的图书馆我知道的实用工具套装。它做了很多事情,当然也解决了你提到的问题。我可以通过使用命令行界面以编程方式运行可用的实用程序(FFmpeg.exe)来使用。



可选,您可以嵌入为图书馆。使用C ++显然是可能的,因为库是用C编写的。如果你需要.NET功能,你也可以这样做:你仍然可以使用非托管库,在C ++ / CLI混合模式(托管+非托管)项目中使用它。您可以在托管的ref类中公开您需要的功能;然后你可以使用这些类引用生成的模块作为通常的.NET程序集。



使用.NET和没有C ++ / CLI,它可能会更复杂,因为它会要求使用P / Invoke。同时,您可以找到合适的包装器。请参阅:

http://www.ffmpeg-csharp.com/ [ ^ ],

http://sourceforge.net/projects/sharpffmpeg/ [ ^ ],

http://vbffmpegwrapper.codeplex.com/ [ ^ ]。



毕竟,尝试找一些: http://bit.ly/VpboUJ [ ^ ]。



如果你想工作在你自己的包装但不知道如何,问一个问题,我会给你基本的想法(使用P / Invoke或C ++ / CLI混合模式项目)。



祝你好运,

-SA
You don't need a player. You need a codec or analogous software. Besides, PictureBox is totally irrelevant. You just need to create some bitmaps out of video.

I would recommend using open-source library or utility FFmpeg or libavcodec: http://en.wikipedia.org/wiki/Ffmpeg[^],
http://ffmpeg.org/[^],
http://en.wikipedia.org/wiki/Libavcodec[^],
http://libav.org/[^].

This is the best library and utility set I ever knew. It does so many things, and of course solves the problem you mentioned. I could be used just by running the available utility (FFmpeg.exe), programmatically or not, using command-line interface.

Optionally, you can embed is as a library. It's apparently possible with C++, as the library is written on C. Same thing if you need .NET functionality: you can still use the unmanaged library, using it in your C++/CLI mixed-mode (managed + unmanaged) project. You can expose just the functionality you need, in managed "ref" classes; then you can use these classes referencing the resulting module as a usual .NET assembly.

With .NET and without C++/CLI, it can be more complex as it would require using P/Invoke. At the same time, you can find appropriate wrapper. Please see:
http://www.ffmpeg-csharp.com/[^],
http://sourceforge.net/projects/sharpffmpeg/[^],
http://vbffmpegwrapper.codeplex.com/[^].

After all, try to find some more: http://bit.ly/VpboUJ[^].

If you wish to work at such wrapper by yourself but don't know how, ask a question, I'll give you the basic ideas (using P/Invoke or C++/CLI "mixed-mode" project).

Good luck,
—SA


这篇关于从视频文件到图片框获取帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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