views:

2025

answers:

2

I'm looking for a simple way to grab thumbnails of FLVs in ASP.NET, without having to change any permissions/settings on the server. Ideally, nothing is installed on the server machine, but if necessary, small tools such as FFmpeg are fine.

I've tried FFmpeg using the command-line tool with Process.Start, but the same command that works in a Windows Forms application and from the command prompt does not work in ASP.NET (presumably because of permissions).

I've also tried using TAO.FFmpeg, and it seems to be working most of the time, but fails randomly, and does not start working again until the machine is restarted. Even when I use the sample code (decoder.cs), it sometimes fails when I try to open multiple videos in a single request.

If this isn't possible in a clean/straightforward way, I'm open to other suggestions.

A: 

If you can embed Flash on a page, the easiest way to show a thumbnail of a FLV is to put a video object on the stage, attach a video to it through a NetStream in actionscript, and then put in an event handler to pause the move immediately after it starts playing.

For example, if you have a video object on the stage called "myVideo", and you're trying to show a thumbnail of "someVideo.flv", try this actionscript (2.0) code,

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
myVideo.attachVideo(stream_ns);
stream_ns.play("someVideo.flv");
stream_ns.seek(0);

stream_ns.onStatus = function(info)
{
    if(info.code = "NetStream.Play.Start")
    {

     stream_ns.pause();
    }
}

In terms of your ASPX talking to your Flash, you could pass the FLV video name to Flash via FlashVars so that your SWF would know what thumbnail to show.

Anjisan
Thanks for your reply. This would work well for a single video, but my situation is more like YouTube -- there will be many thumbnails on each page, and these just link off to a page where the actual video can be played. So, they should be images.
A: 

Try Media Manager Pro at http://www.all4dotnet.com/