28 #include <opencv2/core/core.hpp>
29 #include <opencv2/highgui/highgui.hpp>
32 #include <SimoxUtility/algorithm.h>
42 const std::filesystem::path& file_path,
50 filename_ext +=
".mp4";
53 m_file_path /= filename_ext;
67 m_h264_video_writer = std::make_unique<cv::VideoWriter>();
74 const std::chrono::microseconds timestamp)
76 writeMetadataFrame(frame, timestamp);
78 if (not m_h264_video_writer->isOpened())
80 const int fourcc = cv::VideoWriter::fourcc(
'X',
'2',
'6',
'4');
81 m_h264_video_writer->open(getFilePath().
string(), fourcc, m_fps, frame.size());
83 if (not m_h264_video_writer->isOpened())
86 << getFilePath().string() <<
"' for writing. FRAME DROPPED!";
91 m_h264_video_writer->write(frame);
99 m_h264_video_writer->release();