Commit a512f5b6 authored by Seungha Yang's avatar Seungha Yang

nvenc: Respect display aspect ratio and set to encoding parameter

It should be written in VUI parameter for proper rendering
parent 39c8c206
Pipeline #35932 passed with stages
in 37 minutes and 54 seconds
......@@ -1099,6 +1099,7 @@ gst_nv_base_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
NV_ENC_INITIALIZE_PARAMS *params;
NV_ENC_PRESET_CONFIG preset_config = { 0, };
NVENCSTATUS nv_ret;
gint dar_n, dar_d;
g_atomic_int_set (&nvenc->reconfig, FALSE);
......@@ -1206,6 +1207,14 @@ gst_nv_base_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
GST_FIXME_OBJECT (nvenc, "variable framerate");
}
if (gst_util_fraction_multiply (GST_VIDEO_INFO_WIDTH (info),
GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_PAR_N (info),
GST_VIDEO_INFO_PAR_D (info), &dar_n, &dar_d) && dar_n > 0
&& dar_d > 0) {
params->darWidth = dar_n;
params->darHeight = dar_d;
}
if (nvenc->rate_control_mode != GST_NV_RC_MODE_DEFAULT) {
params->encodeConfig->rcParams.rateControlMode =
_rc_mode_to_nv (nvenc->rate_control_mode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment