Show warning when amd driver adds black bars, set frame resolution after changing video codec context resolution

This commit is contained in:
dec05eba
2024-07-24 01:29:30 +02:00
parent 7d719a44c6
commit e107adbc32
3 changed files with 12 additions and 3 deletions

View File

@@ -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;