Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a thumbnail from an mpg video with C#?

I'd like to process a directory of mpg's in a batch to have a thumbnail using C#/.NET.

Does anyone have any good suggestions on how I could do this?

like image 307
mson Avatar asked Mar 16 '09 23:03

mson


2 Answers

I know it's not C# .NET but ffmpeg is a great tool to do exactly this. Can be run as a command line tool from any language.

Here's a small tutorial to get you started.

like image 85
Ólafur Waage Avatar answered Sep 22 '22 18:09

Ólafur Waage


I did this a few years ago, but I seem to have lost the source. Anyway, the route-of-least-resistance I found was to use DirectShow, there is an interop wrapper for managed code, namely directshow.net. You'll want to use IMediaDet's GetBitmapBits from the Windows Media Format SDK.

There is an example on CodeProject: Extract Frames from Video Files

like image 21
Phil Price Avatar answered Sep 21 '22 18:09

Phil Price