i am currently exploring on how to create thumbnail from video file. so far, i am able to generate thumbnail using ffmpeg but can somebody suggest me if there any other ways to generate thumbnail without involving executable(.exe) file.
Thanks, New Learner, Please guide me...
ffmpeg.exe is the best solution for Video Thumbnails generation as it is free software licensed under the LGPL or GPL.
There are few other places where you will find the solution:
C# Wrapper for the AviFile Library
DirectShow .NET
SlimDX is a free open source framework that enables developers to easily build DirectX applications using .NET technologies such as C#
If you just need a generic thumbnail an easy way to get one is through the WindowsAPICodePack.Shell package. A small, medium, large, or extra large thumbnail can be generated. There's not as much control over the output as ffmpeg but it's hard to beat this method when a generic thumbnail will do or when avoiding an outside exe.
using Microsoft.WindowsAPICodePack.Shell;
using System.Drawing;
namespace GetVideoThumbnail
{
class VideoThumbnail
{
static void Main(string[] args)
{
string videoPath = @"C:\Users\NotSure\Desktop\SampleVideo.MP4";
// Create shell object
ShellObject videoShellObject = ShellObject.FromParsingName(videoPath);
// Create bitmap and/or save locally
Bitmap thumbnailBmp = videoShellObject.Thumbnail.LargeBitmap;
thumbnailBmp.Save(@"C:\Users\NotSure\Desktop\SampleVideoThumbnail.bmp");
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With