diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c index f42f25c48a..b57ba23b99 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c @@ -1847,7 +1847,8 @@ gst_nv_base_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state) if (nv_ret != NV_ENC_SUCCESS) { GST_ELEMENT_ERROR (nvenc, LIBRARY, SETTINGS, (NULL), - ("Failed to %sinit encoder: %d", reconfigure ? "re" : "", nv_ret)); + ("Failed to %sinit encoder: %d- %s", reconfigure ? "re" : "", nv_ret, + NvEncGetLastErrorString (nvenc->encoder))); NvEncDestroyEncoder (nvenc->encoder); nvenc->encoder = NULL; return FALSE; diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c index 7cbd10f50d..a3e1a427cd 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvenc.c @@ -79,6 +79,13 @@ NvEncDestroyEncoder (void *encoder) return nvenc_api.nvEncDestroyEncoder (encoder); } +const char *NVENCAPI +NvEncGetLastErrorString (void *encoder) +{ + g_assert (nvenc_api.nvEncGetLastErrorString != NULL); + return nvenc_api.nvEncGetLastErrorString (encoder); +} + NVENCSTATUS NVENCAPI NvEncGetEncodeGUIDs (void *encoder, GUID * array, uint32_t array_size, uint32_t * count)