Add reference following libraries:
- AForge.Video
- AForge.Video.FFMPEG
// create instance of video reader VideoFileReader reader = new VideoFileReader(); // open video file reader.Open("C:\\test.mp4"); long framecount = reader.FrameCount; // read video frames for (int i = 0; i < framecount; i++) { Bitmap videoFrame = reader.ReadVideoFrame(); videoFrame.Save(Environment.CurrentDirectory + "\\" + i + ".bmp"); // dispose the frame when it is no longer required videoFrame.Dispose(); } reader.Close();
Quickwatch reader object
ReadVideoFrame: Read next video frame of the currently opened video file.
0 comments:
Post a Comment