28#include <opencv2/core/core.hpp>
29#include <opencv2/highgui/highgui.hpp>
32#include <SimoxUtility/algorithm.h>
40 const std::filesystem::path& file_path,
41 const std::string& filename,
45 std::string filename_ext = filename;
46 if (not simox::alg::ends_with(filename_ext,
".avi"))
48 filename_ext +=
".avi";
68 const std::chrono::microseconds
timestamp)
74 const std::string filePath =
getFilePath().string();
75 const int fourcc = cv::VideoWriter::fourcc(
'M',
'J',
'P',
'G');
81 <<
"' for writing. FRAME DROPPED!";
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
virtual void stopRecording()
Stops the recording.
AbstractRecordingStrategy()
Default constructor to start the recording manually.
std::filesystem::path m_file_path
Path to where the recording file should be written to.
virtual void startRecording()
Starts the recording manually if constructed empty.
virtual std::tuple< unsigned int, std::string > writeMetadataFrame(const CByteImage &frame, std::chrono::microseconds timestamp)
virtual std::filesystem::path getFilePath() const
Gets the raw file path for the recording as configured.
void startRecording() override
Starts the recording manually if constructed empty.
std::unique_ptr< cv::VideoWriter > m_avi_video_writer
void recordFrame(const cv::Mat &frame, std::chrono::microseconds timestamp) override
Adds the given frame to the recording.
void stopRecording() override
Stops the recording.
~AVIRecordingStrategy() override
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.