Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Toggle main menu visibility
Loading...
Searching...
No Matches
src
video
H264Encoder.h
1
#pragma once
2
#include "encoder.hpp"
3
4
#include <
string
>
5
#include <
vector
>
6
7
#include <
opencv2/core/core.hpp
>
8
9
namespace
video {
14
class
H264Encoder
{
15
public
:
24
H264Encoder
(
int
fps,
int
rf);
30
std::vector<std::basic_string<uint8_t>
>
encode_frame
(
const
cv::Mat
& frame);
31
32
private
:
33
// A pointer to the h264encoder object that will process frames
34
std::unique_ptr<h264encoder::Encoder>
encoder;
35
// The frame rate of the video being encoded
36
int
fps;
37
// the rf constant for rate control compression
38
int
rf;
39
};
40
}
// namespace video
string
vector
std::vector
std::unique_ptr
cv::Mat
video::H264Encoder::encode_frame
std::vector< std::basic_string< uint8_t > > encode_frame(const cv::Mat &frame)
First frame will set the resolution and subsequent frames must match the resolution.
Definition
H264Encoder.cpp:6
video::H264Encoder::H264Encoder
H264Encoder(int fps, int rf)
Uses the h264encoder library to encode webcam frames into encoded video data.
Definition
H264Encoder.cpp:4
core.hpp
Generated by
1.17.0