Lynx
Lynx

Reputation: 257

Video Thumbnail generation

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...

Upvotes: 3

Views: 4915

Answers (4)

Surfinsanta
Surfinsanta

Reputation: 43

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");
        }
    }
}

Upvotes: 1

JeffRSon
JeffRSon

Reputation: 11216

You may want to try the VideoFileReader from AForge, specifically AForge.Video.FFMPEG.VideoFileReader. It makes use of ffmpeg DLLs.

Alternatively, on Windows 7, you could use ShellFile.Thumbnail from WindowsAPICodePack or use DirectShow to save a frame with VideoRenderer.

I recently used the ShellFile method, with VideoFileReader as backup.

Upvotes: 0

Elyor
Elyor

Reputation: 865

Yea!,good this interestingly Q. I worked it issue,my diploma tasking-at Uni.

And more yet Articles.

1.OpenCV - This Open source project Best worked C/C++,C# and Java

2.Emg CV - This good worked C#

, and more...

Try it's open sources.

Upvotes: 0

Vishal Suthar
Vishal Suthar

Reputation: 17194

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#

Upvotes: 3

Related Questions