diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c index 6ffbd96623..e75a2ca958 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c @@ -2171,6 +2171,12 @@ ensure_control_rate_params (GstVaapiEncoderH264 * encoder) /* HRD params */ fill_hrd_params (encoder, &GST_VAAPI_ENCODER_VA_HRD (encoder)); + + /* FrameRate params */ + GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder) = (VAEncMiscParameterFrameRate) { + .framerate = (guint) GST_VAAPI_ENCODER_FPS_D (encoder) << 16 | + GST_VAAPI_ENCODER_FPS_N (encoder), + }; /* *INDENT-ON* */ return TRUE; diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c index e8bc289d99..33975ab2e1 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c @@ -1771,9 +1771,17 @@ ensure_control_rate_params (GstVaapiEncoderH265 * encoder) if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) == GST_VAAPI_RATECONTROL_CQP) return TRUE; + /* *INDENT-OFF* */ /* HRD params */ fill_hrd_params (encoder, &GST_VAAPI_ENCODER_VA_HRD (encoder)); + /* FrameRate params */ + GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder) = (VAEncMiscParameterFrameRate) { + .framerate = (guint) GST_VAAPI_ENCODER_FPS_D (encoder) << 16 | + GST_VAAPI_ENCODER_FPS_N (encoder), + }; + /* *INDENT-ON* */ + return TRUE; } diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c index 2c284ee4b5..798c00f079 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c @@ -473,6 +473,12 @@ ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder) .buffer_size = base_encoder->bitrate * 1000 * 8, .initial_buffer_fullness = base_encoder->bitrate * 1000 * 4, }; + + /* FrameRate params */ + GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder) = (VAEncMiscParameterFrameRate) { + .framerate = (guint) GST_VAAPI_ENCODER_FPS_D (encoder) << 16 | + GST_VAAPI_ENCODER_FPS_N (encoder), + }; /* *INDENT-ON* */ return TRUE;