Playing a video clip during recording
Note: an MKV file can always be played while it is being recorded, and an MP4 file when VideoPlayableWhileRecording is enabled.
It is possible to play a video clip in a 2nd instance of TVideoGrabber while a 1st instance is recording it in ASF format, as follows:
In the 1st instance of TVideoGrabber:
1.
- set CompressionMode = cm_NoCompression, select the "ASF" recording method (RecordingMethod = rm_ASF),
- invoke StartRecording.
The video clip starts recording, by using the name specified in the RecordingFileName property (unless it is left blank, in which 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 being recorded by the 1st instance
-
set VideoSource = vs_VideoFileOrURL
-
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.