简体   繁体   中英

API for C# for video to frames converstion

Aoa and Hii

i am searching for an API that can be used in C# and that extract all frames from a video.

i am developing a multimedia player for this i need that 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.

the Class for Reading Video Frames is 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM