aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-10-07 18:19:53 +0200
committerdec05eba <dec05eba@protonmail.com>2024-10-07 18:19:53 +0200
commit67bb47a355321eebc513740098d3c0a04302cf95 (patch)
tree393a5e69437b332cc84fb5f6279d1b6de25e9de8 /src/main.cpp
parentef6d265c85cae4c1debbf40a4e6a95feed08cf93 (diff)
More constant bitrate
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index badcd94..181af6b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -536,9 +536,9 @@ static AVCodecContext *create_video_codec_context(AVPixelFormat pix_fmt,
if(bitrate_mode == BitrateMode::CBR) {
codec_context->bit_rate = bitrate;
codec_context->rc_max_rate = codec_context->bit_rate;
- codec_context->rc_min_rate = codec_context->bit_rate;
- codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
- codec_context->rc_initial_buffer_occupancy = codec_context->bit_rate;//codec_context->bit_rate * 1000;
+ //codec_context->rc_min_rate = codec_context->bit_rate;
+ //codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
+ codec_context->rc_initial_buffer_occupancy = 0;//codec_context->bit_rate;//codec_context->bit_rate * 1000;
} else if(bitrate_mode == BitrateMode::VBR) {
const int quality = vbr_get_quality_parameter(codec_context, video_quality, hdr);
switch(video_quality) {
@@ -565,15 +565,15 @@ static AVCodecContext *create_video_codec_context(AVPixelFormat pix_fmt,
}
codec_context->rc_max_rate = codec_context->bit_rate;
- codec_context->rc_min_rate = codec_context->bit_rate;
- codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
- codec_context->rc_initial_buffer_occupancy = 100000;//codec_context->bit_rate * 1000;
+ //codec_context->rc_min_rate = codec_context->bit_rate;
+ //codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
+ codec_context->rc_initial_buffer_occupancy = codec_context->bit_rate;//codec_context->bit_rate * 1000;
}
//codec_context->profile = FF_PROFILE_H264_MAIN;
if (codec_context->codec_id == AV_CODEC_ID_MPEG1VIDEO)
codec_context->mb_decision = 2;
- if(!use_software_video_encoder && vendor != GSR_GPU_VENDOR_NVIDIA) {
+ if(!use_software_video_encoder && vendor != GSR_GPU_VENDOR_NVIDIA && bitrate_mode != BitrateMode::CBR) {
// 8 bit / 10 bit = 80%, and increase it even more
const float quality_multiply = hdr ? (8.0f/10.0f * 0.7f) : 1.0f;
if(codec_context->codec_id == AV_CODEC_ID_AV1 || codec_context->codec_id == AV_CODEC_ID_H264 || codec_context->codec_id == AV_CODEC_ID_HEVC) {