gz/common/VideoEncoder.hh
Go to the documentation of this file.
Set of flags defined by a C++11 enum class.
Definition: gz/common/FlagSet.hh:62
The VideoEncoder class supports encoding a series of images to a video format, and then writing the v...
Definition: gz/common/VideoEncoder.hh:49
bool IsEncoding() const
True if the enoder has been started, false otherwise.
void Reset()
Reset to default video properties and clean up allocated memory. This will also delete any temporary ...
bool AddFrame(const unsigned char *_frame, const unsigned int _width, const unsigned int _height, const std::chrono::steady_clock::time_point &_timestamp)
Add a single timestamped frame to be encoded.
bool AddFrame(const unsigned char *_frame, const unsigned int _width, const unsigned int _height)
Add a single frame to be encoded.
bool Start(const std::string &_format="mp4", const std::string &_filename="", const unsigned int _width=1280, const unsigned int _height=720, const unsigned int _fps=25, const unsigned int _bitRate=0)
Start the encoder. This should be called once. Add new frames to the video using the AddFrame functio...
bool Start(const std::string &_format, const std::string &_filename, const unsigned int _width, const unsigned int _height, const unsigned int _fps, const unsigned int _bitRate, const bool _allowHwAccel)
Start the encoder. This should be called once. Add new frames to the video using the AddFrame functio...
bool SaveToFile(const std::string &_filename)
Write the video to disk param[in] _filename File in which to save the encoded data.
bool Stop()
Stop the encoder. The SaveToFile function also calls this function.
bool Start(const std::string &_format, const std::string &_filename, unsigned int _width, unsigned int _height, unsigned int _fps, unsigned int _bitRate, const FlagSet< HWEncoderType > &_allowedHwAccel, const std::string &_hwAccelDevice="", std::optional< bool > _useHwSurface={})
Start the encoder. This should be called once. Add new frames to the video using the AddFrame functio...
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: gz/common/SuppressWarning.hh:65
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: gz/common/SuppressWarning.hh:68
#define VIDEO_ENCODER_FORMAT_DEFAULT
Definition: gz/common/VideoEncoder.hh:37
#define VIDEO_ENCODER_WIDTH_DEFAULT
Definition: gz/common/VideoEncoder.hh:34
#define VIDEO_ENCODER_BITRATE_DEFAULT
Definition: gz/common/VideoEncoder.hh:33
#define VIDEO_ENCODER_HEIGHT_DEFAULT
Definition: gz/common/VideoEncoder.hh:35
Forward declarations for the common classes.