English 中文(简体)
Capturing a screenshot of an embedded video using C#
原标题:

I am working on a video search engine. Similar to google video. I have noticed that google video has a screen shot from all the videos that they index. I have tried many ways to achieve this with no success. One way that i was suggested is to create an swf that will load the required swf and take a screen shot. however this is not a good solution since i need my video to be indexed automatically.

I have already created the search engine to index all videos. but i am stuck on taking a screen shot.

One thing i have noticed is that the screen shots on google video do not have the play controls of players from various website. This leads me to think that they capture a screen shot from the streaming information and not the flash video.

Does anyone have a clue or a method of how to capture a screen shot of a streaming video using c# Asp.net?

Edit

I am not looking to get a movie and convert it to flash and take a screen shot. I am interested in taking a screen shot of Flash movies on sites like youtube and vimeo. So what i do is index the internet looking for objects tags which i managed to do. But i cannot seem to find a way to take a screen shot. However google managed to do so with google video.

问题回答

here is good blog post to play video in asp.net and create thumbnail. It could help you as hint. The writer has provided source code too.

http://ramcrishna.blogspot.com/2008/09/playing-videos-like-youtube-and.html

This simple method captures the current screen image into a .NET Bitmap object.

private Image CaptureScreen()
{
    Rectangle screenSize = Screen.PrimaryScreen.Bounds;
    Bitmap target = new Bitmap(screenSize.Width,screenSize.Height);
    using(Graphics g = Graphics.FromImage(target))
    {
        g.CopyFromScreen(0,0,0,0,new Size(screenSize.Width,screenSize.Height));
    }
    return target;
}




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签