Fix rate control for AMD cards using VAAPI (#2821)

This commit is contained in:
Cameron Gutman
2024-07-08 10:05:35 -05:00
committed by GitHub
parent c92ed6158a
commit 38c13c8fe1
3 changed files with 23 additions and 0 deletions

View File

@@ -859,6 +859,7 @@ namespace video {
std::make_optional<encoder_t::option_t>("qp"s, &config::video.qp),
"h264_vaapi"s,
},
// RC buffer size will be set in platform code if supported
LIMITED_GOP_SIZE | PARALLEL_ENCODING | SINGLE_SLICE_ONLY | NO_RC_BUF_LIMIT
};
#endif
@@ -1610,6 +1611,9 @@ namespace video {
return nullptr;
}
// Allow the encoding device a final opportunity to set/unset or override any options
encode_device->init_codec_options(ctx.get(), options);
if (auto status = avcodec_open2(ctx.get(), codec, &options)) {
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };