views:

1129

answers:

8

Is there any way where i can create a thumbnail image from a flash movie file(flv /swf) [NOT FROM A VIDEO File ] in ASP.NET ? Any samples of implementation ?

+4  A: 

you can use ffmpeg to create thumbnails of the flash video

Russ Bradberry
is it possible to run the program on a shared hosting environment in medium trust?
zaladane
I'm not sure, but you can try this piece of software: http://www.bytescout.com/swftoimage_swf_to_jpg.html I havent tried it myself but it looks simple enough
Russ Bradberry
@Shyju so, the difference from this answer (which got accepted) and chris is that he got his ffmpeg from "Riva"? http://rivavx.com/?encoder If so, maybe Russ could change his answer and mention that as a "good bundle containing ffmpeg and flv codecs that you can easily use in ASP.NET" or something like that. ;)
Cawas
+2  A: 

For .flv you can use ffmpeg to convert parts of the video (e.g. one frame) into an image (sequence)

I've used it as command-line application by calling Process.Start(), but there is at least one wrapper for .NET (I haven't tested it myself): http://www.codeplex.com/ffmpegdotnet

For .swf I don't know any way to achieve this without some Adobe tool.

chris166
I searched a lot.It seems that there is no wrapper class available in dot net
Shyju
+1  A: 

for flv it can be done easily, as others mentioned ...

for swf, it depends HIGHLY on the swf ... if the swfs visual appearence is determined by code, there is no other way than to embed a flash player in you app and either let the flash player make the snapshots, encode them as JPEG/PNG, and send them somewhere using TCP or LocalConnection (a flash<->flash communication connection, which can be used with C# as well) or try to somehow grab its output buffer yourself ... the first possibility should be no more than 10-20 lines of actionscript code ... don't know about the latter ...

other than that, you might use an external command line converter ... there are a few floating around the web ...

back2dos
+1  A: 

Take a look at this article, it should point you in the right direction. It uses SharpFFmpeg to extract thumbnail images from movie clips from a variety of formats.

Alan
A: 

the only way to get an image, is to use a full flash client that starts playing and allows you to capture the first frame.

I would take a close look at flirt (they actually have an example that renders pngs) Maybe some of the other flash libraries may be of help ( swfdec gnash swift tools gplflash)

Gnash is probably the best choice since its the most mature project out there, but i do not know how easy it is to integrate into command line tools or into your own projects.

Niko
A: 

We have been working on this in my company, and we got a proof of concept working pretty fast (but the project we made it for is on hold right now). I am not able to share the code, but I can give you some pointers.

It is not pure ASP.NET, but maybe you can still use it. We made a windows service that can be called from ASP.NET.

Basicly you install the flash plugin on the server, the windows services can then simply open the swf through the swf ActiveX component and then you can grap a picture of the whole thing. It works pretty well, notice that you do not have to actually render the ActiveX component on screen to capture the picture.

Lillemanden
A: 

Hi. Check out this post. It does not tell you everything but I guess it provides the ground work required for it. You probably have to figure out how to get the object tag out of the flash-html you are trying to download from a web page. After that you'd have to figure out when to capture the frames. Its a long ride however. You don't need the asp.net part. Just concentrate on the windows project part. Hope this helps. :)

deostroll
A: 

It's a really odd library (for example, rather than using an enum for the output format it uses integers, where 1 is PNG, 2 is JPEG, etc.), but Bytescout has a free program which does what you're looking for: http://www.bytescout.com/swftoimage_swf_to_jpg.html

Tyler Menezes