How to get a specific frame from a video file?
Products: Media Player SDK .Net
Using the classic Windows-only SDK engine
You can use the Helpful_GetFrameFromFile method of "VisioForge.Core.VideoEdit.VideoEditCore" or "VisioForge.Core.MediaPlayer.MediaPlayerCore" classes.
Using the new cross-platform X-engine
Use the MediaInfoReaderX class to get the frame.
Get the frame as a System.Drawing.Bitmap
.
var bitmap = MediaInfoReaderX.GetFileSnapshotBitmap("C:\\video.mp4", TimeSpan.Zero);
Get the frame as a SkiaSharp SKBitmap
.
var bitmap = MediaInfoReaderX.GetFileSnapshotSKBitmap("C:\\video.mp4", TimeSpan.Zero);
Get the frame as an RGB byte array.
var bitmap = MediaInfoReaderX.GetFileSnapshotRGB("C:\\video.mp4", TimeSpan.Zero);
Visit our GitHub page to get more code samples.