get thumbnail of divx/avi and mkv video (ASP.net) - 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.

Related

Upload Image to external image service

My meteor application need to be enriched with an image upload functionality. Since many free image upload services exist, I thought the best way of doing it would be by using an existing image upload service. My choice fell on imgur. I guess I somehow have to use imgur's image upload API, but this looks completely alien to me.
Here are my questions:
Is imgur appropriate for what I want? Do you know a better or simpler solution?
How do I upload an image to imgur from my meteor application?
You can assume that the image file comes from an html file input tag. Later on, when the mobile app catches up, the image should come from the camera, but let's just tackle one difficulty at a time.
FSCollection will be a great option here, you can use grids (to store images on the db) or use fs(to store in certain path)
For better explanation i made this tinny demo here is the DEMO and the code
Also i made this example using the progress bar, again here is the link to the DEMO and Source Code
A simpler solution would be to just store images in MongoDB or your filesystem using CollectionFS along with cfs:filesystem for your local file system or cfs:gridfs for MongoDB. The docs are clear and simple enough to get you up and running quickly.
If you wanted to use imgur, you'd need to be able to POST data and understand what you're doing. CollectionFS has a methods package which adds an HTTP POST method to Meteor, but honestly I think that'll just complicate things for you at this point. Keep it local for now.

Creating an image handler in Visual Basic for Ajax file upload

I'm not asking for detailed code for this question, but rather solid direction to learn how to do it myself. There appears to be many methods and directions so just looking for a headstart from someone experienced.
I have a simple file upload control. I want it to operate as an ajax upload, no page-refresh, and if I'm understanding correctly I need http handler that grabs the image and deals with it behind the scenes.
So I need to create a custom control, a new file upload that allows me to set some properties, such as... Path for the image, prefix for three different types (I.e. thm_uniqueimagename.jpg, med_uniqueimagename.jpg, lg_uniqueimagename.jpg) and an option to either KeepOriginal="True/False".
I'd like to see a progress bar while the image is uploading as well. A fantastic example would be a post on Facebook and how you can upload an image.
Right now I'm stuck with a standard upload control that has full post-back/refresh and it's just not nearly as attractive.
I'm just now learning VB... So basically if you can say... Read this tutorial, then do this, then do this... that would be greatly helpful. Just overwhelmed with what to do first, and how to put it all together.
Platform: Windows, .net, etc.
Thank you for any advice.
If you want a better user experience, then I suggest you investigate some solutions like the following:
ASP.NET AJAX file upload
AjaxFileUpload.
Note: If you read the documentation for the ASP.NET AJAX AjaxFileUploader, it says that it requires HTML5 for the progress feedback; otherwise it shows a spinner. So if progress feedback is a necessity and you cannot fully support HTML5 in your target browsers (i.e. older versions of IE; IE6, IE7, IE8, etc.), then you should look into the options below.
Custom HTTP module
NeatUpload is a free option.
Silverlight/Flash option
SWFUpload is a free option.
Asynchronous chunking option
RadAsyncUpload - Telerik's ASP.NET AsyncUpload is a pay option, check website for pricing.

Add Video in ASP.NET MVC

I am working in ASP.NET MVC. I want to add videos in my view. I have read article on Working With Videos in ASP.NET
But i want a generic way to play all type of videos in my web page. This article, although good, but confuses me that how to identify file format and then use related type of Web Helper. There are hundreds of video file formats, how to play all of them, by a single strategy. Mentioned article only describes three formats. Please guide me in this regard.
Your issue is less ASP.NET MVC and more general video playback accross multiple devices in different formats.
Your best option would be to use something like FlowPlayer, which allows you to add a player using either Flash or HTML5/JS (depending on the browser's feature set)
I think to say you want to play all types of videos is the wrong way to start. First of all I would think about what video types you want to support. This can be restricted by things such as the encoded videos available, file size, browser support.
Once you have decided on this you can look in to finding the most suitable player for the job.

Scale images before upload

I have upload control on my asp.net (C#) page, I always upload pictures. Is there any way to scale images before I upload ?
You'll have to do something like flash on the client to do this, have a look here and here for examples.
It can't be done in JavaScript, etc...you'll need something with a bit more file system access, e.g. Flash, Silverlight, JavaApplet, etc. But seeing as there are premade flash solutions out there, that's the route I'd take.
A couple of solutions to your issue are below, since you haven't really specified how/where exactly you want to handle the image scaling.
http://upload.thinfile.com/image/
http://www.resize-before-upload.com/

.NET : How to Create thumbnail from flash

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

Resources