9 #ifndef CscCaptureFileRecorder_h
10 #define CscCaptureFileRecorder_h
16 using cv::VideoWriter, std::thread;
63 unsigned long long lastNotOpenedWarningLogTime;
66 optional<short> durationSeconds = {};
67 const fs::path outputPath;
68 const fs::path tempRecordingPath;
69 const fs::path tempLastRecordingPath;
77 Status status = Status::CLOSED;
79 int writtenFramesCounter = 0;
81 mutex videoRecordingMutex;
82 mutex videoRecordingLastMutex;
83 mutex videoRecordingExtractMutex;
84 system_clock::time_point videoRecordingStartTime;
86 thread *recorderThread =
nullptr;
87 void recorderThreadAction();
89 VideoWriter *videoWriterRecording =
nullptr;
91 VideoWriter *initVideoWriter(
const fs::path &outputPath,
const Resolution &resolution,
const string &description);
93 void ensureMp4VideoPath(
const fs::path &videoPath);
95 void ffmpeg(
const string &command);
97 fs::path getRecording(
const fs::path &snapshotOutputPath = fs::temp_directory_path() / (
"recordingSnapshot_" +
to_string(
nowMillis()) +
".mp4"));
99 unique_ptr<CscLogger> logger =
nullptr;