views:

680

answers:

2
+3  Q: 

Thumbnail video C#

Is it possible to create a thumbnail image of a video in C# (like the first frame)?

Little update: I'll need a thumbnail image of an FLV video in C# since I'm using Flex to show video's. And yes, links to some libraries would be useful.

+3  A: 

There are Open Source libraries you can use to do this. Check out OpenCVDotNet, a managed .NET wrapper for OpenCV, a "computer vision" library. Here's a link to a tutorial you may find useful.

Kevin Babcock
My first impression is that it only supports avi... and I'll need flv's to be supported. But I'll have to check this to be sure.
Lieven Cardoen
+3  A: 

I can think of two options off the top of my head:

  1. Use an external tool, like ffmpeg, to generate thumbnails. This is probably the most commonly implemented solution to this problem.
  2. Parse the FLV file and only send the file only to the end of the first I Frame. (You can find the parsing logic in code that allows you to seek into the middle of an FLV by time mark.
Stu Thompson
FFMPEG is the only solution I could find. There are some .NET libraries out there that provide a managed wrapper around FFMPEG, but I couldn't find any documentation on how to use them. I'm interested to hear what solution you come up with!
Kevin Babcock
I just shell out to ffmpeg and parse the output. It works fine for me and is not as complex or hacky as it might sound. I've read about the C API to ffmpeg, but that seems like too much effort.
Stu Thompson