[英]API for C# for video to frames converstion
Aoa和Hii
我正在尋找可在C#中使用並從視頻中提取所有幀的API 。
我正在為此開發一個多媒體播放器 ,我需要該API。
任何人都可以向我發送鏈接或任何有用的信息嗎? ?
提前致謝。
您可以在Aforge.Video.FFMPEG組件中使用Aforge框架中的FFMPEG包裝器。
讀取視頻幀的類是VideoFileReader
這是一個示例:
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();
}
}
}
您可以從https://aforgeffmpeg.codeplex.com/下載該軟件包
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.