[FFmpeg-cvslog] avcodec/nvenc: print minimum driver version on error
Timo Rothenpieler
git at videolan.org
Thu Jun 1 17:09:17 EEST 2017
ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Thu Jun 1 11:55:25 2017 +0200| [cb3358b68fa750a4e0361b46e17d2d8560bb5265] | committer: Timo Rothenpieler
avcodec/nvenc: print minimum driver version on error
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb3358b68fa750a4e0361b46e17d2d8560bb5265
---
libavcodec/nvenc.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index d7420d7166..160e642614 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -112,6 +112,16 @@ static int nvenc_print_error(void *log_ctx, NVENCSTATUS err,
return ret;
}
+static void nvenc_print_driver_requirement(AVCodecContext *avctx, int level)
+{
+#if defined(_WIN32) || defined(__CYGWIN__)
+ const char *minver = "378.66";
+#else
+ const char *minver = "378.13";
+#endif
+ av_log(avctx, level, "The minimum required Nvidia driver for nvenc is %s or newer\n", minver);
+}
+
static av_cold int nvenc_load_libraries(AVCodecContext *avctx)
{
NvencContext *ctx = avctx->priv_data;
@@ -125,8 +135,10 @@ static av_cold int nvenc_load_libraries(AVCodecContext *avctx)
return ret;
ret = nvenc_load_functions(&dl_fn->nvenc_dl);
- if (ret < 0)
+ if (ret < 0) {
+ nvenc_print_driver_requirement(avctx, AV_LOG_ERROR);
return ret;
+ }
err = dl_fn->nvenc_dl->NvEncodeAPIGetMaxSupportedVersion(&nvenc_max_ver);
if (err != NV_ENC_SUCCESS)
@@ -139,6 +151,7 @@ static av_cold int nvenc_load_libraries(AVCodecContext *avctx)
"Required: %d.%d Found: %d.%d\n",
NVENCAPI_MAJOR_VERSION, NVENCAPI_MINOR_VERSION,
nvenc_max_ver >> 4, nvenc_max_ver & 0xf);
+ nvenc_print_driver_requirement(avctx, AV_LOG_ERROR);
return AVERROR(ENOSYS);
}
More information about the ffmpeg-cvslog
mailing list