我如何获得一个视频缩略图在净? [英] How do I get a Video Thumbnail in .Net?

查看:119
本文介绍了我如何获得一个视频缩略图在净?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待实现一个功能,从检索输入视频的单个帧,这样我就可以把它作为一个缩略图。

这些方针的东西应该工作:

  //文件名的例子:test.avi,test.dvr-MS
//位置是从0到100%(0.0〜1.0)
//返回一个位图
byte []的GetVideoThumbnail(字符串文件名,浮位置)
{
}
 

有谁知道如何做到这一点在.NET 3.0?

正确的解决方案将是最好的执行此功能。 奖励积分,避免选择空白帧。

解决方案

我结束了我自己的滚动单独的类(与我描述的一个方法)

,原因可能的 github.com/2823028">viewed~~V。 媒体浏览器是 GPL的,但我很高兴为code我写的这个文件是公共领域。请记住,它采用互操作的 directshow.net 的项目,所以你将必须清除这部分的code与他们。

这个类将不会为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屋!

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