Skip to content

Commit c25f059

Browse files
committed
obs-ffmpeg: Use 2 tile columns in NVENC AV1 for 4K+
When resolution is 4K or higher, use 2 tile columns for NVENC AV1.
1 parent 5d0323e commit c25f059

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/obs-ffmpeg/obs-nvenc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,14 @@ static bool init_encoder_av1(struct nvenc_data *enc, obs_data_t *settings,
938938
if (config->rcParams.rateControlMode == NV_ENC_PARAMS_RC_CBR)
939939
av1_config->enableBitstreamPadding = 1;
940940

941+
#define PIXELCOUNT_4K (3840 * 2160)
942+
943+
/* If size is 4K+, set tiles to 2 uniform columns. */
944+
if ((voi->width * voi->height) >= PIXELCOUNT_4K) {
945+
av1_config->enableCustomTileConfig = 0;
946+
av1_config->numTileColumns = 2;
947+
}
948+
941949
switch (voi->colorspace) {
942950
case VIDEO_CS_601:
943951
av1_config->colorPrimaries = 6;

0 commit comments

Comments
 (0)