Skip to content

Commit

Permalink
obs-ffmpeg: Increase initial buffer fullness for VAAPI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nowrep authored and Lain-B committed Jul 8, 2023
1 parent 046719f commit 5fdda17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5fdda17

Please sign in to comment.