[fix] reset openh264 target bitrate

This commit is contained in:
dijunkun
2024-09-18 09:46:45 +08:00
parent a0bccfe53d
commit 0e3da6daf8
2 changed files with 3 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ int OpenH264Encoder::InitEncoderParams(int width, int height) {
// 0: auto (dynamic imp. internal encoder) // 0: auto (dynamic imp. internal encoder)
// 1: single thread (default value) // 1: single thread (default value)
// >1: number of threads // >1: number of threads
encoder_params_.iMultipleThreadIdc = 1; encoder_params_.iMultipleThreadIdc = 8;
// The base spatial layer 0 is the only one we use. // The base spatial layer 0 is the only one we use.
encoder_params_.sSpatialLayers[0].iVideoWidth = encoder_params_.iPicWidth; encoder_params_.sSpatialLayers[0].iVideoWidth = encoder_params_.iPicWidth;
encoder_params_.sSpatialLayers[0].iVideoHeight = encoder_params_.iPicHeight; encoder_params_.sSpatialLayers[0].iVideoHeight = encoder_params_.iPicHeight;

View File

@@ -49,8 +49,8 @@ class OpenH264Encoder : public VideoEncoder {
int frame_width_ = 1280; int frame_width_ = 1280;
int frame_height_ = 720; int frame_height_ = 720;
int key_frame_interval_ = 300; int key_frame_interval_ = 300;
int target_bitrate_ = 1000; int target_bitrate_ = 10000000;
int max_bitrate_ = 2500000; int max_bitrate_ = 10000000;
int max_payload_size_ = 1400; int max_payload_size_ = 1400;
int max_frame_rate_ = 30; int max_frame_rate_ = 30;
std::vector<std::vector<uint8_t>> encoded_packets_; std::vector<std::vector<uint8_t>> encoded_packets_;