28 #include <opencv2/core/core.hpp>
29 #include <opencv2/highgui/highgui.hpp>
32 #include <SimoxUtility/algorithm.h>
40 const std::filesystem::path& file_path,
48 filename_ext +=
".avi";
51 m_file_path /= filename_ext;
63 m_avi_video_writer = std::make_unique<cv::VideoWriter>();
68 const std::chrono::microseconds
timestamp)
72 if (not m_avi_video_writer->isOpened())
74 const std::string filePath = getFilePath().string();
75 const int fourcc = cv::VideoWriter::fourcc(
'M',
'J',
'P',
'G');
76 m_avi_video_writer->open(filePath, fourcc, m_fps, frame.size());
78 if (not m_avi_video_writer->isOpened())
81 <<
"' for writing. FRAME DROPPED!";
86 m_avi_video_writer->write(frame);
93 m_avi_video_writer->release();