我如何获得一个视频缩略图在净? [英] How do I get a Video Thumbnail in .Net?
问题描述
我期待实现一个功能,从检索输入视频的单个帧,这样我就可以把它作为一个缩略图。
这些方针的东西应该工作:
//文件名的例子:test.avi,test.dvr-MS
//位置是从0到100%(0.0〜1.0)
//返回一个位图
byte []的GetVideoThumbnail(字符串文件名,浮位置)
{
}
有谁知道如何做到这一点在.NET 3.0?
正确的解决方案将是最好的执行此功能。 奖励积分,避免选择空白帧。
解决方案我结束了我自己的滚动单独的类(与我描述的一个方法)
这个类将不会为DVR-MS文件的工作,你需要为这些注入的Direct Show过滤器。
I'm looking to implement a function that retrieves a single frame from an input video, so I can use it as a thumbnail.
Something along these lines should work:
// filename examples: "test.avi", "test.dvr-ms"
// position is from 0 to 100 percent (0.0 to 1.0)
// returns a bitmap
byte[] GetVideoThumbnail(string filename, float position)
{
}
Does anyone know how to do this in .Net 3.0?
The correct solution will be the "best" implementation of this function. Bonus points for avoiding selection of blank frames.
I ended up rolling my own stand alone class (with the single method I described), the source can be viewed here. Media browser is GPL but I am happy for the code I wrote for that file to be Public Domain. Keep in mind it uses interop from the directshow.net project so you will have to clear that portion of the code with them.
This class will not work for DVR-MS files, you need to inject a direct show filter for those.
这篇关于我如何获得一个视频缩略图在净?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!