VideoShotMaker User's Manual |
About VideoShotMakerVideoShotMaker is an ActiveX component that allows your applications to extract frames from video files and save them into image files. Frames can be extracted from AVI, MPEG, WMV, RealVideo files (please see the system requirements for details). Result images can be saved into JPEG or BMP files. Before saving images can be resized, cropped and marked by text labels. To go to the VideoShotMaker home page, please click here. How to install the trial versionFollow the steps below to install the trial version of component on your server:
Note: the trial version will never expire, but it places a trial message on created images. Purchase
The trial version is intended for evaluation purposes only. How to install the full versionFollow the steps below to install the full version of component on your server:
How to useTo create a thumbnail of an image using VideoShotMaker, follow these simple steps:
Below you can see a few examples of using VideoShotMaker in ASP script. Read the frame from the video file and save it to the image file: <% set tn = server.createObject("briz.VideoShotMaker") tn.OpenVideoFile "c:\temp\video.mpeg" tn.ReadFrame 1 tn.SaveFrame "c:\temp\image.bmp" tn.EncodeToJpeg tn.SaveFrame "c:\temp\image.jpg" tn.Close %> Read the frame from the video file, resize it and save it to database: <% set tn = server.createObject("briz.VideoShotMaker") tn.OpenVideoFile "c:\temp\video.mpeg" tn.ReadFrame 1 tn.Resize 100, 100 'Connect to Access database and open the "photos" table strConnect = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & "c:\temp\db.mdb" Set rs = Server.CreateObject("adodb.recordset") rs.Open "frames", strConnect, 1, 3 'Append the row to table rs.AddNew 'Assign the thumbnail data to table field rs("frame").Value = tn.BinaryData rs.Update rs.Close Set rs = Nothing %> Object ReferenceMethodsSub OpenVideoFile(FileName As String)
Opens a video file.
Sub Close()
Closes the opened video file and frees the resources.
Sub ReadFrame(Time as Double)
Reads the specified frame from the opened file.
The Time parameter specifies the time of frame that should be readed (in seconds). Sub SaveFrame(FileName As String)
Saves the loaded frame to the specified file.
if the EncodeToJpeg method was performed before, it creates the JPEG file. Otherway BMP file. Sub EncodeToJpeg(Quality as Byte, Progressive as Boolean)
Specifies that output image will be encoded to JPEG.
The Quality parameter specifies the JPEG encoding quality. Valid values are 1-100. This parameter is optional, by default is 80. The Progressive parameter specifies whether an image can be progressively displayed when it is decompressed. This parameter is optional, by default is True. Sub Resize(MaxWidth As Long, MaxHeight As Long, Crop As Boolean)
Reduces the loaded frame to MaxWidth and MaxHeight maintaining its aspect ratio.
If the Crop parameter is True, the image will be croped before resizing. The result size of image will be MaxWidth x MaxHeight exactly. This parameter is optional, by default is False. Sub DrawFrame(Width As Byte, Color As OleColor)
Draws the frame around the loaded image.
The Width parameter specifies the frame width in pixels, this parameter is optional and
by default is set to 1.
The Color parameter specifies the frame color, this parameter is optional and by
default is set to vbBlack.
For example:
tn.DrawFrame 'Draws the frame with width 1 pixel and black color. tn.DrawFrame 2, vbGray tn.DrawFrame 1, &h00505050 Sub DrawText(X As Long, Y As Long, Text As String)
Draws a text string on the loaded image.
The X and Y parameters specify the position for drawing the text.
Sub SetFont(FontName As String, FontSize As Long, Bold As Boolean, Italic As Boolean, Underline As Boolean, Color As OleColor)
Sets the font parameters for the DrawText method.
For example:
tn.SetFont "Arial", 18, True, False, False, vbWhite PropertiesProperty Duration As Double (read-only)
Specifies the length of opened video file in seconds.
Property Width As Long (read-only)
Specifies the current image width.
Property Height As Long (read-only)
Specifies the current image height.
Property BinaryData As Variant (read-only)
Represents the binary data that contains the current image.
Copyright © 2006 BRIZ Software
|