StartCapture
Top  Previous  Next

Description

Starts time-lapse video capture to the specified AVI file or series of image files (bmp, tif or jpg). Use StopCapture to end video capture.


Syntax


[VB]
objActiveDcam.StartCapture File [, Timelapse = 0, Playrate = 0 ]

[C/C++]
HRESULT StartCapture( bstr File, float Timelapse, float Playrate );



Data Types [VB]

File : String
Timelapse : Single (optional)
Playrate : Single (optional)

Parameters
[C/C++]

File [in]  
The string containing the path to the avi file or image file (bmp, tif or jpg).  
Timelapse [in]  
The interval between consecutive frames in seconds  
Playrate [in]  
The frame rate at which AVT file will be played in frames per second  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  
E_INVALIDARG  
Invalid file name.  


Example


This VB example demonstrates how to capture the video to an AVI file at the current frame rate:.

Private Sub
StartButton_Click()
ActiveDcam1.StartCapture "c:\mycapture.avi"

End Sub


Private Sub
StopButton_Click()
ActiveDcam1.StopCapture

End Sub


This C# example demonstrates how to capture a series of TIFF images at 0.5 sec interval:

private
void
startbutton_Click(object
sender, System.EventArgs e)
{
   axActiveDcam1.StartCapture("c:\\images\\myframe.tif", 0.5, 0.);   
}

private
void
stopbutton_Click(object
sender, System.EventArgs e)
{
   axActiveDcam1.StopCapture();   
}


Remarks

To record compressed AVI files, use ShowCompressionDlg, SetCodec and ShowCodecDlg. If no codec has been selected, ActiveDcam will record AVI files in the uncompressed format, 8- or 24-bits per pixel.

If bmp, tif or jpg extension is specified for the file path, the file name is used as a template to which the ordinal number of the frame captured is appended. In the C# example above consecutive frames will be stored to files "myframe00001.tif", myframe00002.tif" and so on. Note that TIF format can store 16- and 48-bit per pixel images.

If Timelapse is not specified, the video will be recorded at the maximum frame rate defined by the camera settings and system throughput.

If Playrate is not specified, the video will be played back at the same rate it was captured.