Skip to content

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.

A video clip can be played 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 and select the "ASF" recording method (RecordingMethod = rm_ASF).
  2. Invoke StartRecording. The video clip starts recording with 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.
  2. Set VideoSource = vs_VideoFileOrURL.
  3. Invoke StartPreview.

The video clip being recorded then starts playing in the 2nd instance of TVideoGrabber.

This can be tested quickly with MainDemo.exe, as follows:

  1. Run a first instance of MainDemo.exe, then:
    • 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 being recorded appears in the memo on the left: copy it to the clipboard.
  2. Run a 2nd instance of MainDemo.exe, then:
    • in the "video source = file or URL" group, click on the "open" button and paste the name of the file being recorded,
    • browse the "VIDEO SOURCE" list and select "video file or URL",
    • click on the "Start" preview button.

The video clip being recorded in the 1st instance of MainDemo.exe then starts playing in the 2nd instance.

Note

The clip played while recording is not seekable, because the total duration is determined only when the recording completes.