From e107adbc32ebae14e6f0ae49338a95e8d31d9d84 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 24 Jul 2024 01:29:30 +0200 Subject: Show warning when amd driver adds black bars, set frame resolution after changing video codec context resolution --- src/encoder/video/vaapi.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/encoder') diff --git a/src/encoder/video/vaapi.c b/src/encoder/video/vaapi.c index 952fab4..910eb18 100644 --- a/src/encoder/video/vaapi.c +++ b/src/encoder/video/vaapi.c @@ -168,6 +168,13 @@ static bool gsr_video_encoder_vaapi_start(gsr_video_encoder *encoder, AVCodecCon } } + if(video_codec_context->width != frame->width || video_codec_context->height != frame->height) { + fprintf(stderr, "gsr warning: gsr_video_encoder_vaapi_start: black bars have been added to the video because of a bug in AMD drivers/hardware. Record with h264 codec instead (-k h264) to get around this issue\n"); + } + + frame->width = video_codec_context->width; + frame->height = video_codec_context->height; + if(!gsr_video_encoder_vaapi_setup_context(encoder_vaapi, video_codec_context)) { gsr_video_encoder_vaapi_stop(encoder_vaapi, video_codec_context); return false; -- cgit v1.2.3