Playing a video clip during recording
How to play a video clip while it is recording?
Description
It is possible to play a video clip in a 2nd instance of TVideoGrabber while it is recording in ASF format a 1st instance as follows:
In the 1st instance of TVideoGrabber:
1.
- set CompressionMode = cm_NoCompression
- select the "ASF" recording method (RecordingMethod = rm_ASF),
2. invoke StartRecording.
The video clip starts recording, by using the name specified in the RecordingFileName property (unless you left it blank, in this case a recording file name is generated automatically and returned by the OnRecordingStarted event).
In the 2nd instance of TVideoGrabber:
1. set VideoSource_FileOrUrl = the path / name of the file currently recording the 1st instance
2. set VideoSource = vs_VideoFileOrURL
3. invoke StartPreview
and the video clip currently recording will start playing in the 2nd instance of TVideoGrabber.
This can be tested quickly by running MainDemo.exe as follows:
a)
- run a first instance of MainDemo.exe,
- click on the "Recording" tab,
- select "ASF" as recording method (on the right of the tab),
- click on "start recording"
The name of the file currently recording will appear in the memo on the left, copy it to the clipboard.
b)
- run a 2nd instance of MainDemo.exe,
- in the "video source = file or URL" group, click on the "open" button and paste the name of the file currently recording
- browse the "VIDEO SOURCE" list, and select "video file or URL"
- then click on the "Start" preview button
and the video clip currently recording in the 1st instance of MainDemo.exe will start playing in the 2nd instance.
Remark: the clip played while recording is not seekable, because the total duration will be determined only when the recording completes.