.NET : How to Create thumbnail from flash - asp.net

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 ?

you can use ffmpeg to create thumbnails of the flash video

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.

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 ...
greetz
back2dos

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.

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.

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.

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. :)

Related

Get information about pics and video files with qt

Well i have a project in which gets pics and videos from folders and also i can view them it it and when i view them i want to also see those tags kinda like the camera which took it, dimensions , the ISO, the exposure time and others for pics and camera model framerate and dimensions...
Thanks in advance
I've never seen anything like this in Qt. Anyway, Qt is a C++ framework, you can use whatever library you want to use. QImageMetaData and QMeta are very near Qt style, but can only be used for images (never tried those).
Anyway, I would use the XMP toolkit. You also mentioned videos, so in that case XMP can handle both. It is very simple to use, well documented and fast (license is BSD). It is written in C++, so you can port it on whatever platform you want.
I think Qt itself does not provide a way to extract exif data (which is what I guess you're trying to extract). You could perhaps try QMeta. I have not used this myself, so no guarantees.

Export animation to movie

I am creating effects in my AIR application using actionscript like fadeIn and fadeOut. is there any way to export those animation to movie format like FLV or AVI using actionscript?
Thanks
I don't think there's going to be any way to do this on the web unless you stream the data to some sort of server like Red5 or Flash Media Server or something along those lines. If you're just looking to capture the effects and can build/run the app as an AIR app you can probably use the class found here http://www.zeropointnine.com/blog/assets_code/SimpleFlvWriter.as.txt to get it to save the data to a file. You can use (can't post multiple links damn stackoverflow for not linking my accounts correctly...) google "BitmapData draw flex reference"
in order to draw the stage to a bitmapdata object then you'd have to push that data into the SimpleFlvWriter.as (not as simple as it sounds :) ), sorry don't know of a boxed solution for this let me know if you're able to make anything of it and good luck! oh also as an aside you may be able to get away with just using something like SnagIt depending on the fidelity you're looking for.

get thumbnail of divx/avi and mkv video (ASP.net)

When the user uploads a video (only divx/avi/mkv allowed) I'd like to get a thumbnail for the video so that is can be displayed in the divx player before play is clicked. Is there any way to do this is ASP.net or javascript.
The easiest way to do this would be to use something like FFMpeg, though it's a command line application and you'd probably need to write some kind of wrapper around it. For more information on the exact parameters you might need to use, check out Creating video thumbnails using ffmpeg.
There are some other options, such as Flash Video MX SDK, but they tend to be COM solutions rather than managed code and are generally quite clunky to implement. They can also be quite expensive, which may make them unfeasible.
You can use ffmpeg to create your thumbnails.
Checkout this blog post : link
In .net you can create Process and pass arguments to execute the tool from your code.

Showing a form from a webpage

I have a problem I am trying to solve in an elegant manner. I have a .net application that I have created. I am trying to get one of the forms to be shown from a webpage. This sounds strange I'll admit, so here is the backstory
We have some large monitors at work, that show information on them. I have no control over how the information is displayed. Currently they are just using a browser and tabbing in the browser to show each different piece of information on the screen. Most of the info they show is just standard html stuff, text and images.
Now along comes my winforms application. The part of the application I need to show is a graphical display. Everything on this display is drawn using GDI+, if that matters. I need to get this form into a format that I can show. Below is my own solution, but I am pretty sure this is not the best method, but it may be the only method I can use
Create a console application. The application would do the following
1. Run as a service on a server
2. Create the display in memory, and save it to a bitmap every so ofter
3. Save the bitmap to a location on the network.
4. have an HTML file that links the image that can be shown in the browser
I though about doing something with the clients, however the clients are not always up, so I could have periods where the image wouldnt be updated.
I also was thinking about an ASP.net solution, but that would require me to learn ASP.net, and I am not quite ready to take that challenge
In IE you can host a winforms app/control as an ActiveX control, like so:
<object id="DateTimePicker" height="31" width="177"
classid="bin/Web.Controls.DateTime.dll#Web.Controls.DateTime.DateTimePicker" VIEWASTEXT>
</object>
See this article for more information: http://www.codeproject.com/KB/miscctrl/htmlwincontrol.aspx
Now, I'm not claiming that this is any more elegant than your solution, but it is an alternative.
I think using Asp.Net to serve a dynamic image using a HttpHandler would be the best approach, but depending on your skills and time this may not be an option. Here is a nice tutorial: http://www.codeguru.com/columns/dotnet/article.php/c11013
IMHO The best way to build this would be as a browser plug-in, like how Flash works. Microsoft has created a plug-in framework called SpicIE, that allows you develop managed plug-ins for IE. This is probably your best bet.
The old unmanaged way is to build out your WinForms dll app and then package it in a signed cab file, and then reference that cab file with an HTML object tag (codebase arg is the one you need).
i.e.,
document.write("<object CLASSID='clsid:DC187740-46A9-11D5-A815-00B0D0428C0C' CODEBASE='/MyFormsApp/MyFormsApp.cab#Version=1,00,0000' />");
The first time the user hits the page they will be asked to allow for the installer to load its payload (dll's). Once they do, they will have a fully fledged WinForms desktop APP running through a browser window.
I took the easy route on this one. I created a small winform app, that coverts the GDI objects to a bitmap, and then I save the bitmap to a network share. This file is refenced in a simple HTML file that is displayed on the monitor.
I chose the winform app, because it makes it really easy for me to set this up in task manager, and run it every 10 minutes to update.

How do I display a PDF in Adobe Flex?

Looking for a way to display a PDF in Flex. I'm sure there are several ways. Looking for the easiest to maintain / integrate / most user friendly. I'm guessing it's possible to display a browser window in the app and render it, but if it goes off of IE / FireFox it's not acceptable for this project.
Thanks...
This looks like a nice PDF viewer for flex http://www.devaldi.com/?p=212
We just did a large AIR app that used PDF quite a bit - make sure you save yourself some heartache and write some code to check the acrobat version or that it's even installed - if they don't have it you won't get an error, just a blank HTML control.
I know, it sounds obvious, but still...
Sorry to say so, but convertion PDF to kind of swf of flash things... doesn't that kill the PDF thoughts ?
I mean, PDF should be electronic paper right ? When creating a SWF file out of it, you just destroy that. No more editing, no more filling out a form.
The strange thing is, that PDF is an Adobe product... and Flex (Flash Builder) is a Adobe product.
Two products that Adobe wants to be world dominator off. But combining PDF into Flex... is not standard.
Check out: http://www.swftools.org/ for tools to convert your PDF to SWF, speifically pdf2swf- http://www.swftools.org/pdf2swf.html
Check out Share on Acrobat.com, there you can upload PDFs and make them embedable Flash files (sort of like YouTube for documents). Should be possible to load those into Flex. Not an ideal solution, but unfortunately you need to convert the PDF to an SWF somehow to be able to load it into a Flex application. I don't know of any good tools that do this. If someone else knows please share.
If you target AIR you can load a PDF into a HTML view, but that doesn't work when running in the browser (the HTML component is only available in AIR).
in Adobe Digital Edition, Adobe Load PDFs into flash (if you check the main file .exe you can see it), without any convert. therefore i think it is possible to do.
i decompiled it and found lot of classes related to pdf but i can't run it after recompiled it :(
if you solve this problem you should focus the Adobe Digital Edition product.
Oh sweet, this is an air app. I'll go with the HTML view. I can't convert them to SWF because the client will be uploading the files.
if AIR Application,
use HTMLLoader().

Resources