17#ifndef GAZEBO_COMMON_VIDEOENCODER_HH_
18#define GAZEBO_COMMON_VIDEOENCODER_HH_
27#define VIDEO_ENCODER_BITRATE_DEFAULT 0
28#define VIDEO_ENCODER_WIDTH_DEFAULT 1280
29#define VIDEO_ENCODER_HEIGHT_DEFAULT 720
30#define VIDEO_ENCODER_FPS_DEFAULT 25
31#define VIDEO_ENCODER_FORMAT_DEFAULT "mp4"
38 class VideoEncoderPrivate;
73 const std::string &_filename =
"",
93 public:
bool AddFrame(
const unsigned char *_frame,
94 const unsigned int _width,
95 const unsigned int _height);
104 const unsigned int _width,
105 const unsigned int _height,
106 const std::chrono::steady_clock::time_point &_timestamp);
127 private: std::unique_ptr<VideoEncoderPrivate> dataPtr;
common
Definition FuelModelDatabase.hh:37
#define VIDEO_ENCODER_FORMAT_DEFAULT
Definition VideoEncoder.hh:31
#define VIDEO_ENCODER_FPS_DEFAULT
Definition VideoEncoder.hh:30
#define VIDEO_ENCODER_WIDTH_DEFAULT
Definition VideoEncoder.hh:28
#define VIDEO_ENCODER_BITRATE_DEFAULT
Definition VideoEncoder.hh:27
#define VIDEO_ENCODER_HEIGHT_DEFAULT
Definition VideoEncoder.hh:29
The VideoEncoder class supports encoding a series of images to a video format, and then writing the v...
Definition VideoEncoder.hh:47
bool IsEncoding() const
True if the enoder has been started, false otherwise.
virtual ~VideoEncoder()
Destructor.
void Reset()
Reset to default video properties and clean up allocated memory.
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.
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.
unsigned int BitRate() const
Get the bit rate.
std::string Format() const
Get the encoding format.
VideoEncoder()
Constructor.
Forward declarations for the common classes.
Definition Animation.hh:27