home forums resources search newsjoinmembers: 6956
Sections PHP Flash Java Ruby Windows Linux
windows's picture

windows | Wed, 2008-07-30 15:49  tags: , , , , ,

Robert Simpson shows a way he found a way to get a Classic ASP script to interact with FFmpeg and create a thumbnail from the first frame of a video file without any user interaction or file manipulation.

It goes something like this:

  1. User uploads a video file to his web server
  2. User runs a specially prepared script
  3. The script detects the file's type
  4. A Wscript fires off a command to create the thumbnail and save it to a specified directory

The script looks something like this (see the attachment for more info):


<%
option explicit
dim sExecuteable
dim oShell
dim sVideoFilepath
dim sOutputFilepath
dim cmd
sExecuteable = "ffmpeg.exe"
sVideoFilepath = "sphere1.wmv"
sOutputFilepath = "sphere.png"
cmd = server.mappath(sExecuteable) & " -y -i """& _
server.mappath(sVideoFilepath) &""" -vframes 1 -an _
-vcodec png -f rawvideo -s 320x240  """&_
server.mappath(sOutputFilepath) &""""
set oShell = server.createobject("Wscript.Shell")
oShell.run cmd
set oShell = nothing
%>

Note that this works off a specially compiled version of FFmpeg, so it may not work for everyone. And for all you non-Windows users, beware! I have no clue if it'll work for you.

Download the the files and save them on your web server. Then, execute the default.asp script through your browser.


Happy Publishing!

windows's picture
Join Hiveminds and link to your website or blog.
Thoughtbox - So what did you think?



 
CMS Comparison Matrix
 
Windows Content Management Systems Silverlight Drupal Web Developers Drupal

Newsletter

Get updates on Hiveminds services, articles and downloads by signing up for the newsletter.

Editor's choice

Some of the better articles, stories and tutorials found at Hiveminds.

Find more

Find more of Hiveminds articles, stories, tutorials and user comments by searching.




Picked links

Hand picked websites and articles from around the web that provide quality reading.