Sam*_*ron 26 .net c# video-processing
我正在寻找一个从输入视频中检索单个帧的函数,所以我可以将它用作缩略图.
这些方面的东西应该有效:
// 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)
{
}
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何在.Net 3.0中这样做?
正确的解决方案将是此功能的"最佳"实现.避免选择空白帧的奖励点.
Sam*_*ron 10
我最终滚动了自己的独立课程(使用我描述的单一方法),可以在这里查看源代码.媒体浏览器是 GPL,但我很高兴我为该文件编写的代码是Public Domain.请记住,它使用directshow.net项目中的interop,因此您必须使用它们清除该部分代码.
此类不适用于DVR-MS文件,您需要为这些文件注入直接显示过滤器.
该项目将为AVI提供技巧:http://www.codeproject.com/KB/audio-video/avifilewrapper.aspx
任何其他格式,你可能会看看directshow.有一些项目可能有所帮助:
http://sourceforge.net/projects/directshownet/
http://code.google.com/p/slimdx/
1- 从以下位置获取最新版本的 ffmpeg.exe:http ://ffmpeg.arrozcru.org/builds/
2-解压文件并将 ffmpeg.exe 复制到您的网站
3- 使用此代码:
Process ffmpeg;
string video;
string thumb;
video = Server.MapPath("first.avi");
thumb = Server.MapPath("frame.jpg");
ffmpeg = new Process();
ffmpeg.StartInfo.Arguments = " -i "+video+" -ss 00:00:07 -vframes 1 -f image2 -vcodec mjpeg "+thumb;
ffmpeg.StartInfo.FileName = Server.MapPath("ffmpeg.exe");
ffmpeg.Start();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
34135 次 |
最近记录: |