Go to the documentation of this file.
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 =
"",
86 public:
bool IsEncoding()
const;
93 public:
bool AddFrame(
const unsigned char *_frame,
94 const unsigned int _width,
95 const unsigned int _height);
103 public:
bool AddFrame(
const unsigned char *_frame,
104 const unsigned int _width,
105 const unsigned int _height,
106 const std::chrono::steady_clock::time_point &_timestamp);
111 public:
bool SaveToFile(
const std::string &_filename);
115 public: std::string Format()
const;
119 public:
unsigned int BitRate()
const;
123 public:
void Reset();
127 private: std::unique_ptr<VideoEncoderPrivate> dataPtr;
bool Stop()
Stop the encoder.
VideoEncoder()
Constructor.
Forward declarations for the common classes.
Definition: Animation.hh:26
bool SaveToFile(const std::string &_filename)
Write the video to disk param[in] _filename File in which to save the encoded data.
common
Definition: FuelModelDatabase.hh:37
std::string Format() const
Get the encoding format.
void Reset()
Reset to default video properties and clean up allocated memory.
bool IsEncoding() const
True if the enoder has been started, false otherwise.
The VideoEncoder class supports encoding a series of images to a video format, and then writing the v...
Definition: VideoEncoder.hh:46
virtual ~VideoEncoder()
Destructor.
#define VIDEO_ENCODER_BITRATE_DEFAULT
Definition: VideoEncoder.hh:27
#define VIDEO_ENCODER_FPS_DEFAULT
Definition: VideoEncoder.hh:30
bool AddFrame(const unsigned char *_frame, const unsigned int _width, const unsigned int _height)
Add a single frame to be encoded.
unsigned int BitRate() const
Get the bit rate.
#define VIDEO_ENCODER_FORMAT_DEFAULT
Definition: VideoEncoder.hh:31
#define VIDEO_ENCODER_WIDTH_DEFAULT
Definition: VideoEncoder.hh:28
#define VIDEO_ENCODER_HEIGHT_DEFAULT
Definition: VideoEncoder.hh:29
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.