#
How to start capture without stopping the preview?
You can start and stop video capture without stopping the preview. You can use it for video capture, screen capture, and other capture modes.
Add new output with default settings. We'll use MP4 output in this example.
File name will be ignored because we'll start capture later.
VideoCapture1.Outputs_Add(new MP4Output("output.mp4"), false); // false - don't start capture immediately.
Start video preview (video capture not started at this moment).
await VideoCapture1.StartAsync();
Start actual video capture to file or other output, for example, RTMP output.
await VideoCapture1.StartCaptureAsync(0, "output.mp4"); // 0 - index of the output.
Stop actual video capture if needed
await VideoCapture1.StopCaptureAsync(0); // 0 - index of the output.
Enable separate capture.
VideoCapture1.SeparateCapture_Enabled = cbSeparateCaptureEnabled.Checked;
Enable Video Capture mode (or Screen Capture, etc.).
VideoCapture1.Mode = VideoCaptureMode.VideoCapture;
Set output format settings.
VideoCapture1.Output_Format = ...
Start video capture/preview (real video capture not started at this moment).
await VideoCapture1.StartAsync();
Start actual video capture.
await VideoCapture1.SeparateCapture_StartAsync();
Stop actual video capture if needed
await VideoCapture1.SeparateCapture_StopAsync();
or change the output file name on the fly.
await VideoCapture1.SeparateCapture_ChangeFilenameOnTheFlyAsync("newfile.mp4");
#
Required redists
Visit our GitHub page to get more code samples.