aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-24 01:29:30 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-24 01:29:30 +0200
commite107adbc32ebae14e6f0ae49338a95e8d31d9d84 (patch)
tree544b894a3857aee4eef8b23b48c0ff1c0f937100 /src
parent7d719a44c6ce76ecfc05287d0cbb2b36e84b4ca6 (diff)
Show warning when amd driver adds black bars, set frame resolution after changing video codec context resolution
Diffstat (limited to 'src')
-rw-r--r--src/encoder/video/vaapi.c7
1 files changed, 7 insertions, 0 deletions
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;