Browse Source

obs-ffmpeg: Increase initial buffer fullness for VAAPI

Default ffmpeg initial buffer fullness (75%) is too low
and results in significantly lower video quality on AMD cards.

Changing it to 100% fixes the quality and also matches what
AMF encoder is doing.
David Rosca 2 years ago
parent
commit
5fdda179ed
1 changed files with 2 additions and 0 deletions
  1. 2 0
      plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c

+ 2 - 0
plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c

@@ -300,6 +300,8 @@ static bool vaapi_update(void *data, obs_data_t *settings, bool hevc)
 	enc->context->level = level;
 	enc->context->bit_rate = bitrate * 1000;
 	enc->context->rc_max_rate = maxrate * 1000;
+	enc->context->rc_initial_buffer_occupancy =
+		(maxrate ? maxrate : bitrate) * 1000;
 
 	enc->context->width = obs_encoder_get_width(enc->encoder);
 	enc->context->height = obs_encoder_get_height(enc->encoder);