Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Movie thumbnails in .NET (.mov, .mpg .avi > .jpg)

Status
Not open for further replies.

StuckInTheMiddle

Programmer
Mar 3, 2002
269
0
0
US
Asked this the other day in the wrong forum, Is it possible to get a thumbnail of a movie file in .NET? (Any movie file format will do, .Mov, .Avi, .Mpg, .MP4 media files for instance)

I have cliet that has a web site that accepts user submitted videos, much like youtube but they don't encode anything right now. They just allow users to host their movie but instead of just showing a standard ICON to the user as I do right now they want to be able to grab a frame from the video, say the first frame, or 100th frame and save that as a JPEG.

I did a search of various forums here and couldn't see an answer to my problem and didn't get any help from the asp.net folks unfortunately so I'm hoping someone here can assist as I'm stuck on this one.


"If you can stay calm, while all around you is chaos...then you probably haven't completely understood the seriousness of the situation.
 
One quick solution is to use the MediaDetClass of Dexter Type Library. There is a sample in Code project see link below:


Here is an extract of code from their sample:
Code:
     MediaDetClass md = new MediaDetClass();
     md.Filename = "sample.avi";      
     md.CurrentStream = 0;
     string fBitmapName = "sample" + ".bmp" ;
     
     //Write the 11th frame on a file
     md.WriteBitmapBits( 10, 320, 240, fBitmapName );

     //Load the file daa into a PictureBox bitmap
     pictureBox1.Image = new Bitmap(fBitmapName);

You should also be able to create a simple project and add as reference to your project Dexter Library from COM list of reference and use the MediaDetClass.

Hope this helps.

Credits to the above go to Daniel049 (see link above)



[small]"It is in our collective behaviour that we are most mysterious" Lewis Thomas [/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top