H264RecordingStrategy Class Reference

Concrete strategy for a H264 video recording. More...

#include <VisionX/libraries/imrec/record/strats/H264RecordingStrategy.h>

+ Inheritance diagram for H264RecordingStrategy:

Public Member Functions

 H264RecordingStrategy ()
 
 H264RecordingStrategy (const std::filesystem::path &filePath, const std::string &name, double fps)
 
void recordFrame (const cv::Mat &frame, std::chrono::microseconds timestamp) override
 Adds the given frame to the recording. More...
 
void startRecording () override
 Starts the recording manually if constructed empty. More...
 
void stopRecording () override
 Stops the recording. More...
 
 ~H264RecordingStrategy () override
 
- Public Member Functions inherited from AbstractRecordingStrategy
 AbstractRecordingStrategy ()
 Default constructor to start the recording manually. More...
 
 AbstractRecordingStrategy (const std::filesystem::path &filePath)
 Constructor for any recording strategy, immediately starting the recording. More...
 
virtual std::filesystem::path getDotExtension () const
 Gets the extension plus preceeded dot of the configured file (e.g. More...
 
virtual std::filesystem::path getFilePath () const
 Gets the raw file path for the recording as configured. More...
 
virtual std::filesystem::path getMetadataPath () const
 
virtual std::filesystem::path getPath () const
 Gets the path to the recording without filename. More...
 
virtual std::filesystem::path getStem () const
 Gets the stem of the configured file (filename without extension) More...
 
virtual bool isRecording () const
 Indicates whether this instance is already initialised for recording. More...
 
virtual void recordFrame (const CByteImage &frame, std::chrono::microseconds timestamp)
 Adds the given frame to the recording. More...
 
virtual void writeMetadataDatetime (const std::string &var_name, std::chrono::microseconds timestamp)
 
virtual std::tuple< unsigned int, std::string > writeMetadataFrame (const CByteImage &frame, std::chrono::microseconds timestamp)
 
virtual std::tuple< unsigned int, std::string > writeMetadataFrame (const cv::Mat &frame, std::chrono::microseconds timestamp)
 
virtual void writeMetadataLine (const std::string &var_name, std::string_view var_type, std::string_view var_value)
 
virtual ~AbstractRecordingStrategy ()
 Destructor. More...
 

Protected Attributes

double m_fps
 
std::unique_ptr< cv::VideoWriter > m_h264_video_writer
 
- Protected Attributes inherited from AbstractRecordingStrategy
std::filesystem::path m_file_path
 Path to where the recording file should be written to. More...
 

Detailed Description

Concrete strategy for a H264 video recording.

Definition at line 48 of file H264RecordingStrategy.h.

Constructor & Destructor Documentation

◆ H264RecordingStrategy() [1/2]

Definition at line 35 of file H264RecordingStrategy.cpp.

◆ H264RecordingStrategy() [2/2]

H264RecordingStrategy ( const std::filesystem::path &  filePath,
const std::string &  name,
double  fps 
)

Definition at line 41 of file H264RecordingStrategy.cpp.

◆ ~H264RecordingStrategy()

~H264RecordingStrategy ( )
override

Definition at line 57 of file H264RecordingStrategy.cpp.

Member Function Documentation

◆ recordFrame()

void recordFrame ( const cv::Mat &  frame,
std::chrono::microseconds  timestamp 
)
overridevirtual

Adds the given frame to the recording.

Parameters
frameFrame to be added

Reimplemented from AbstractRecordingStrategy.

Definition at line 72 of file H264RecordingStrategy.cpp.

+ Here is the call graph for this function:

◆ startRecording()

void startRecording ( )
overridevirtual

Starts the recording manually if constructed empty.

Parameters
filePathPath to where the recording file should be written to
fpsAmount of frames being recorded per second

Reimplemented from AbstractRecordingStrategy.

Definition at line 64 of file H264RecordingStrategy.cpp.

+ Here is the call graph for this function:

◆ stopRecording()

void stopRecording ( )
overridevirtual

Stops the recording.

Reimplemented from AbstractRecordingStrategy.

Definition at line 96 of file H264RecordingStrategy.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_fps

double m_fps
protected

Definition at line 54 of file H264RecordingStrategy.h.

◆ m_h264_video_writer

std::unique_ptr<cv::VideoWriter> m_h264_video_writer
protected

Definition at line 55 of file H264RecordingStrategy.h.


The documentation for this class was generated from the following files: