[These pages contain ready ASP scripts. You can use them in your own applications]

ASP SCRIPT: Creating preview of AVI, MPEG, QuickTime movies

Note: all scripts examples included in these Web pages are absolutely free. You can copy, use, and modify these scripts anyway you want. The scripts are published without warranty of any kind.

What is this

This ASP script builds the thumbnail (preview) image of movie files: AVI, MPEG, or QuickTime. The script uses first movie frame as a preview image. The image size is reducing twice.
If the first frame can not be drawn, the script produces 10x10 black image.


Internet Explorer 4.0 or higher should be installed on your server. The movie files should not be corrupted. Before running this script, try to logon to your NT server interactively and play that kind of movies there. Make sure there are no any error messages.
Your Internet NT account should have permissions to read the movie file and create objects (you can use the dcomcnfg utility to grant those permissions if it will be necessary).
The movie file should have .avi, .mpg, .mpeg, .qt or .mov extension.
Some registry settings must be present on your NT4.0 server to make movie files available through this mechanism. Windows 2000 machine already has all necessary settings installed, so you have not to apply this settings on Windows 2000:

File viewmovie.asp
Set g=CreateObject("shotgraph.image")
' The FULL PATH to movie file


Sub Main()
g.CheckObject movie_file,xsize,ysize
if xsize>0 then
' The movie file can be drawn. Calculating the new size
	g.CreateImage xsize,ysize,8
' Drawing the first frame of the movie
	g.DrawObject movie_file,"CONTENT",0,0,xsize,ysize
' The movie file can not be drawn
' Creating the empty image 10x10
	g.CreateImage xsize,ysize,8
end if
' Outputting image to client
Response.BinaryWrite g.JpegImage(75,0,"")
End Sub

This is the content of the file with registry settings for server:
File movies.reg

@="Video Clip"


@="Video Clip"


@="Movie Clip"







Back to examples