Skip to content

Commit

Permalink
tweak x265 encoder settings
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Dec 1, 2024
1 parent d24ff61 commit 360669e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion amalgamation/toxcore_amalgamation.c
Original file line number Diff line number Diff line change
Expand Up @@ -82738,7 +82738,8 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
x265_param_parse(param, "intra-refresh", "1");

x265_param_parse(param, "frame-threads", "3");
x265_param_parse(param, "strict-cbr", "1");


x265_param_parse(param, "log-level", "debug");

printf("vc_init_encoder_h265:vc->h264_enc_bitrate = %d\n", (int)vc->h264_enc_bitrate);
Expand All @@ -82756,6 +82757,10 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
param->rc.bitrate = 800;
printf("vc_init_encoder_h265:bit_rate = %d\n", (int)(bit_rate / 1000));

x265_param_parse(param, "strict-cbr", "1");
param.rc.vbvBufferSize = 800 * VIDEO_BUF_FACTOR_H264;
param.rc.vbvMaxBitrate = 800 * 1;

// Range of values: an integer from 0 to 51
// x265_param_parse(param, "qp", "50");

Expand Down
7 changes: 6 additions & 1 deletion toxav/codecs/h264/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,8 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
x265_param_parse(param, "intra-refresh", "1");

x265_param_parse(param, "frame-threads", "3");
x265_param_parse(param, "strict-cbr", "1");


x265_param_parse(param, "log-level", "debug");

printf("vc_init_encoder_h265:vc->h264_enc_bitrate = %d\n", (int)vc->h264_enc_bitrate);
Expand All @@ -1991,6 +1992,10 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
param->rc.bitrate = 800;
printf("vc_init_encoder_h265:bit_rate = %d\n", (int)(bit_rate / 1000));

x265_param_parse(param, "strict-cbr", "1");
param.rc.vbvBufferSize = 800 * VIDEO_BUF_FACTOR_H264;
param.rc.vbvMaxBitrate = 800 * 1;

// Range of values: an integer from 0 to 51
// x265_param_parse(param, "qp", "50");

Expand Down

0 comments on commit 360669e

Please sign in to comment.