| 1234567891011121314151617181920212223242526272829303132333435363738 |
- #ifndef REMOTEAR2_VIDEO_ENCODER_H
- #define REMOTEAR2_VIDEO_ENCODER_H
- #include <opencv2/core/types.hpp>
- #include <glad/gl.h> // make windows happy
- #include <cuda_gl_interop.h>
- #include <memory>
- class video_encoder {
- public:
- video_encoder();
- ~video_encoder();
- bool start_encode(cv::Size size, int fps, int bitrate,
- bool save_file = false, bool save_frame_length = true);
- void stop_encode();
- bool encode_frame(void *frame_ptr, void **output_ptr, size_t *output_size);
- bool encode_frame(cudaGraphicsResource *res, void **output_ptr, size_t *output_size);
- bool is_encoding();
- // force next frame to be IDR frame
- void refresh();
- private:
- struct impl;
- std::unique_ptr<impl> pimpl;
- };
- #endif //REMOTEAR2_VIDEO_ENCODER_H
|