And set it for MJPEG.
Showing the changes to libavcodec/vaapi_encode.c (1 of 3 files). Show all
Unified · Split
| @@ -1277,7 +1277,8 @@ static av_cold int vaapi_encode_init_rate_control(AVCodecContext *avctx) · 1276 unmodified lines | ||
| 1277 | 1277 | ctx->va_rc_mode = VA_RC_CQP; |
| 1278 | 1278 | return 0; |
| 1279 | 1279 | } |
| 1280 | − if (avctx->flags & AV_CODEC_FLAG_QSCALE || | |
| 1280 | + if (ctx->codec->flags & FLAG_CONSTANT_QUALITY_ONLY || | |
| 1281 | + avctx->flags & AV_CODEC_FLAG_QSCALE || | |
| 1281 | 1282 | avctx->bit_rate <= 0) { |
| 1282 | 1283 | if (rc_attr.value & VA_RC_CQP) { |
| 1283 | 1284 | av_log(avctx, AV_LOG_VERBOSE, "Using constant-quality mode.\n"); |