TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Windows Media

How to create thumbnails

Windows Media

 
 
Thread Tools Display Modes
Unread 13-02-2008, 11:20 PM   #1
AndrewAtUnicorn
Guest
 
Posts: n/a
How to create thumbnails

We have a system that ingests thousands of video files a day. I need this
system to be able to create a thumbnail from a specified position (seconds)
in a WMV file. Right now we do this by playing the file, programatically
pausing after x seconds, and capturing a screen shot which is then saved
programmatically. This doesn't work so well much of the time.

I need a better way, can anyone give me any suggestions? Our encoder is
programmed in C# using the Windows Media Encoder SDK.

 
Unread 14-02-2008, 12:21 AM   #2
Alessandro Angeli
Guest
 
Posts: n/a
Re: How to create thumbnails

From: "AndrewAtUnicorn"

> We have a system that ingests thousands of video files a
> day. I need this system to be able to create a thumbnail
> from a specified position (seconds) in a WMV file. Right
> now we do this by playing the file, programatically
> pausing after x seconds, and capturing a screen shot
> which is then saved programmatically. This doesn't work
> so well much of the time.
>
> I need a better way, can anyone give me any suggestions?
> Our encoder is programmed in C# using the Windows Media
> Encoder SDK.


The easiest way is to use the MediaDet object. You can
import its automation wrapper in .NET:

http://msdn.microsoft.com/archive/de...adetobject.asp

or create a full managed wrapper for it from the C++
interface definitions:

http://msdn.microsoft.com/archive/de...adetobject.asp

The DirectShow.NET project on sf.net might have the wrapper
ready.

Otherwise, you can use the WM[Sync]Reader object in the WMF
runtime (see the WindowsMediaFormat SDK) but you will need
to write a managed wrapper for and DirectShow.NET can only
help so far.

Last, you can use DirectShow through DirectShow.NET:

1. create an empty graph

2. insert a SampleGrabber into the graph

3. configure the SampleGrabber to only accept the
uncompressed video format you like

4. call RenderFile()

5. remove the clock

7. seek to media

8. run and the grabber will provide you with the bitmap

You might also want to mute the audio or add a second
grabber that accepts any kind of audio that you can just
throw away.

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm



 
Unread 02-05-2008, 12:18 PM   #3
Matthew McDermott
Guest
 
Posts: n/a
Re: How to create thumbnails

Alessandro,

I am interested in generating thumbnails too. I was wondering if there is a
way to do this "on the fly". Here is the scenario.

I am generating search results from WMV files that have been indexed with an
Audio Video IFilter. The IFilter extracts WMV properties like Title, Artist,
Description, etc. I would like to show a thumbnail of the video.

I think the only way to do this is to render a Media Player Control on the
page for each result. (Though this sounds painful...) I might try it with a
Silverlight control instead.

Do you have any ideas for better options?

TIA!



--
Matthew McDermott, MVP
Principal Consultant
Catapult Systems, Inc.


"Alessandro Angeli" wrote:

> From: "AndrewAtUnicorn"
>
> > We have a system that ingests thousands of video files a
> > day. I need this system to be able to create a thumbnail
> > from a specified position (seconds) in a WMV file. Right
> > now we do this by playing the file, programatically
> > pausing after x seconds, and capturing a screen shot
> > which is then saved programmatically. This doesn't work
> > so well much of the time.
> >
> > I need a better way, can anyone give me any suggestions?
> > Our encoder is programmed in C# using the Windows Media
> > Encoder SDK.

>
> The easiest way is to use the MediaDet object. You can
> import its automation wrapper in .NET:
>
> http://msdn.microsoft.com/archive/de...adetobject.asp
>
> or create a full managed wrapper for it from the C++
> interface definitions:
>
> http://msdn.microsoft.com/archive/de...adetobject.asp
>
> The DirectShow.NET project on sf.net might have the wrapper
> ready.
>
> Otherwise, you can use the WM[Sync]Reader object in the WMF
> runtime (see the WindowsMediaFormat SDK) but you will need
> to write a managed wrapper for and DirectShow.NET can only
> help so far.
>
> Last, you can use DirectShow through DirectShow.NET:
>
> 1. create an empty graph
>
> 2. insert a SampleGrabber into the graph
>
> 3. configure the SampleGrabber to only accept the
> uncompressed video format you like
>
> 4. call RenderFile()
>
> 5. remove the clock
>
> 7. seek to media
>
> 8. run and the grabber will provide you with the bitmap
>
> You might also want to mute the audio or add a second
> grabber that accepts any kind of audio that you can just
> throw away.
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>
>
>
>

 
Unread 14-05-2008, 12:20 AM   #4
Alessandro Angeli
Guest
 
Posts: n/a
Re: How to create thumbnails

From: "Matthew McDermott"

> I am generating search results from WMV files that have
> been indexed with an Audio Video IFilter. The IFilter
> extracts WMV properties like Title, Artist, Description,
> etc. I would like to show a thumbnail of the video.


If you are only interested in WMV, the easiest way to
extract a frame is to use the WMSyncReader object provided
by the WindowsMediaFormat runtime (see the WMF SDK): you
open the file in the reader, seek to whatever point you want
and read 1 frame, which by default you will get as a
decompressed bitmap. Since the reader will seek to a
keyframe regardless of the time you specified, the seek
operation will be fast (as long as the file is indexed).

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 08:59 PM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional