Skip to content
Snippets Groups Projects
Commit 5c68309e authored by Christian Dreher's avatar Christian Dreher
Browse files

fix: MP4 for H264.

parent c481d3c6
No related branches found
No related tags found
No related merge requests found
......@@ -38,14 +38,16 @@ visionx::imrec::strats::H264RecordingStrategy::H264RecordingStrategy()
}
visionx::imrec::strats::H264RecordingStrategy::H264RecordingStrategy(const std::filesystem::path& file_path, const std::string& filename, const double fps) :
visionx::imrec::AbstractRecordingStrategy(file_path),
m_fps{fps}
visionx::imrec::strats::H264RecordingStrategy::H264RecordingStrategy(
const std::filesystem::path& file_path,
const std::string& filename,
const double fps) :
visionx::imrec::AbstractRecordingStrategy(file_path), m_fps{fps}
{
std::string filename_ext = filename;
if (not simox::alg::ends_with(filename_ext, ".mp4"))
{
filename_ext += ".avi";
filename_ext += ".mp4";
}
m_file_path /= filename_ext;
......@@ -67,7 +69,9 @@ visionx::imrec::strats::H264RecordingStrategy::startRecording()
void
visionx::imrec::strats::H264RecordingStrategy::recordFrame(const cv::Mat& frame, const std::chrono::microseconds timestamp)
visionx::imrec::strats::H264RecordingStrategy::recordFrame(
const cv::Mat& frame,
const std::chrono::microseconds timestamp)
{
writeMetadataFrame(frame, timestamp);
......@@ -78,7 +82,8 @@ visionx::imrec::strats::H264RecordingStrategy::recordFrame(const cv::Mat& frame,
if (not m_h264_video_writer->isOpened())
{
ARMARX_ERROR << deactivateSpam() << "Could not open the output video file '" << getFilePath().string() << "' for writing. FRAME DROPPED!";
ARMARX_ERROR << deactivateSpam() << "Could not open the output video file '"
<< getFilePath().string() << "' for writing. FRAME DROPPED!";
return;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment