Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
video::H264Encoder Class Reference

This class encodes OpenCV frames into encoded H264 data that can be sent to an H264 decoder, like JMuxer. More...

#include <H264Encoder.h>

Public Member Functions

 H264Encoder (int fps, int rf)
 Uses the h264encoder library to encode webcam frames into encoded video data.
 
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.
 

Detailed Description

This class encodes OpenCV frames into encoded H264 data that can be sent to an H264 decoder, like JMuxer.

Constructor & Destructor Documentation

◆ H264Encoder()

video::H264Encoder::H264Encoder ( int fps,
int rf )

Uses the h264encoder library to encode webcam frames into encoded video data.

Parameters
fpsThe framerate of the input video/frames to be encoded.
rfThe RF factor for the encoder. Max 51, Min 1. Higher values mean more compression and smaller encoded frame sizes, but they also lead to lower quality. This value shouldn't be below 21 as values below this have essentially the same quality while having much larger encoded frame sizes.

Member Function Documentation

◆ encode_frame()

std::vector< std::basic_string< uint8_t > > video::H264Encoder::encode_frame ( const cv::Mat & frame)

First frame will set the resolution and subsequent frames must match the resolution.

Parameters
frameA reference to an OpenCV 2D Matrix representing the frame to be encoded.
Returns
A vector of video data units representing the encoded frame

The documentation for this class was generated from the following files: