27#ifndef EASY3D_VIDEO_ENCODER_H
28#define EASY3D_VIDEO_ENCODER_H
34 class VideoEncoderImpl;
69 explicit VideoEncoder(
const std::string& file_name,
int framerate = 30,
int bitrate = 8 * 1024 * 1024);
96 bool encode(
const unsigned char* image_data,
int width,
int height,
PixelFormat pixel_format);
104 static bool is_size_acceptable(
int width,
int height) {
return (width % 8) == 0 && (height % 8) == 0; }
107 internal::VideoEncoderImpl* encoder_;
109 const std::string file_name_;
110 const int framerate_;
VideoEncoder(const std::string &file_name, int framerate=30, int bitrate=8 *1024 *1024)
Constructor to initialize the video encoder.
Definition video_encoder.cpp:595
PixelFormat
The supported pixel formats for the video frames.
Definition video_encoder.h:75
@ PIX_FMT_RGB_888
Packed RGB 8:8:8, 24bpp, RGBRGB...
Definition video_encoder.h:76
@ PIX_FMT_BGR_888
Packed BGR 8:8:8, 24bpp, BGRBGR...
Definition video_encoder.h:77
@ PIX_FMT_RGBA_8888
Packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition video_encoder.h:78
@ PIX_FMT_BGRA_8888
Packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition video_encoder.h:79
bool encode(const unsigned char *image_data, int width, int height, PixelFormat pixel_format)
Encodes one frame to the video stream.
Definition video_encoder.cpp:628
~VideoEncoder()
Destructor to clean up resources.
Definition video_encoder.cpp:619
static bool is_size_acceptable(int width, int height)
Checks if the image size (width, height) is acceptable.
Definition video_encoder.h:104
Definition collider.cpp:182