PlayVideo (DVR version only)
Top  Previous  Next

Description

Plays back the currently open video file (AVI or TIF) or memory sequence in the ActiveGige window.


Syntax


[VB]
objActiveGige.PlayVideo [ Start, End, Increment ]


[C/C++]
HRESULT PlayVideo( long Start, long End, long Increment );


Data Types
[VB]

Start: Long
End: Long
Increment: Long

Parameters
[C/C++]

Start [in]  
The zero-based index of the frame of the video file or sequence at which the playback will start. If omitted, the whole file or sequence will be played forward. If -1, the whole file or sequence will be played backward.  
End [in]  
The zero-based index of the frame at which the playback will stop. If omitted, the playback will stop at the last frame. If End < Start, the specified fragment will be played backward.  
Increment [in]  
The increment of frames during the playback. If 2, every second frame will be played. If 3, every third frame will be played, and so on. If 0, 1 or ommitted, the playback of every frame will occur.  

Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB example opens an AVI file and plays its fragment while updating the frame count.


Private Sub
Play_Click()
ActiveGige1.OpenVideo "C:\\video1.avi"
ActiveGige1.PlayVideo 0, 50
End Sub


Dim
frameplayed
As Integer


Private Sub
ActiveGige1_FrameLoaded()
frameplayed = frameplayed + 1
LabelCount.Caption = frameplayed
End Sub

Private Sub
ActiveGige1_PlayCompleted (ByVal Frames As Long)
ActiveGige1.CloseVideo

End Sub



Remarks


The video will be played at the frame rate at which it was recorded unless the SetVideoFPS method is applied.

If the video file was recorded with compression, a corresponding codec must be installed on the system in order to play it back. Note that the playback frame rate of a compressed video file can become significantly reduced if the video is played backward or the Increment parameter used.

Per each frame of the video file or sequence played, the FrameLoaded event will be fired. When the playback is finished, the PlayCompleted event will be fired.

During the playback frames are being extracted from the video file or memory sequence and loaded into the internal ActiveGige buffer. The pixels of the currently loaded frame can be accessed via ActiveGige image access functions (GetImageData, GetImagePointer, GetImageWindow etc).

During the playback of a memory sequence all current conversion properties (such as Bayer, WindowLevel, BkgCorrect, Rotate) will be applied to the frames of the sequence in real time.

Calling this method will automatically turn off the live video by setting the Acquire property to FALSE.