[英]API for C# for video to frames converstion
Aoa and Hii Aoa和Hii
i am searching for an API that can be used in C# and that extract all frames from a video. 我正在寻找可在C#中使用并从视频中提取所有帧的API 。
i am developing a multimedia player for this i need that API. 我正在为此开发一个多媒体播放器 ,我需要该API。
anyone can send me the link or any helpful info for this? 任何人都可以向我发送链接或任何有用的信息吗? ? ?
thanks in advance. 提前致谢。
You can use FFMPEG wrapper from Aforge framework its in Aforge.Video.FFMPEG assembly. 您可以在Aforge.Video.FFMPEG组件中使用Aforge框架中的FFMPEG包装器。
the Class for Reading Video Frames is VideoFileReader
读取视频帧的类是VideoFileReader
Here is a sample: 这是一个示例:
using System;
using AForge.Video.FFMPEG;
namespace TEF
{
static class Program
{
private static void Main()
{
var reader = new VideoFileReader();
reader.Open(@"your video here");
// video attributes
Console.WriteLine("width: " + reader.Width);
Console.WriteLine("height: " + reader.Height);
Console.WriteLine("fps: " + reader.FrameRate);
Console.WriteLine("codec: " + reader.CodecName);
// read video frames
while (true)
using (var videoFrame = reader.ReadVideoFrame())
{
if (videoFrame == null)
break;
// process the frame here
}
reader.Close();
}
}
}
you download the package from https://aforgeffmpeg.codeplex.com/ 您可以从https://aforgeffmpeg.codeplex.com/下载该软件包
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.