This component records a stream from a capture engine to a video file. It has 2 modes: 1) simple: records everything until close is called 2) rolling: records last X seconds maximum (shorter of course if close is called after start before reaching duration). In this mode, once duration is reached, video file is trimmed so only the last seconds remain. IMPORTANT: this 2nd mode is not suited for long recordings (not efficient for this need). This should only be used for a few seconds. A warning will be printed for duration > 60s
- Note
- for now, output format is hardcoded to mp4. Please implement other format as needed, ffmpeg natively supports many things (mp4 with H.264, H.265, ...)
| optional< fs::path > conscience_core::media_capture::CscCaptureFileRecorder::tryGetRecording |
( |
const fs::path & |
snapshotOutputPath = fs::temp_directory_path() / ("recordingSnapshot_" + to_string(nowMillis()) + ".mp4") | ) |
|
Returns a path to an up to date recording (last X seconds) without stopping recording IMPORTANT: This requires video cut and merge, reuse result if you can. Note: for now, output format is hardcoded to mp4. Please implement other format as needed, ffmpeg natively supports many things (mp4 with H.264, H.265, ...)
- Returns
- empty if recorder is not opened yet