NVIDIA JETSON NX HW decoding library is not usable with ffmpeg and worst


Followed instruction from here, https://developer.nvidia.com/ffmpeg.

Please maintain proper quality. Do not provide or publish unusable stuff.


root@jetson:/opt/anyconnect/ffmpeg# ./ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -vsync 0 -i video.mp4 -vf scale_npp=1920:1072 -vcodec h264_nvenc out0.h264 -vf scale_npp=1280:720 -vcodec h264_nvenc out1.h264
ffmpeg version N-98902-g1a35fffaf2 Copyright © 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --enable-pic --enable-shared
WARNING: library configuration mismatch
avutil configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --prefix=/opt/anyconnect/ffmpeg_build --enable-pic --enable-shared
avcodec configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --prefix=/opt/anyconnect/ffmpeg_build --enable-pic --enable-shared
avformat configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --prefix=/opt/anyconnect/ffmpeg_build --enable-pic --enable-shared
avdevice configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --prefix=/opt/anyconnect/ffmpeg_build --enable-pic --enable-shared
avfilter configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --prefix=/opt/anyconnect/ffmpeg_build --enable-pic --enable-shared
swscale configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --prefix=/opt/anyconnect/ffmpeg_build --enable-pic --enable-shared
swresample configuration: --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --extra-cflags=’-I/usr/local/cuda/include -fPIC’ --extra-ldflags=-L/usr/local/cuda/lib64 --prefix=/opt/anyconnect/ffmpeg_build --enable-pic --enable-shared
libavutil 56. 58.100 / 56. 57.100
libavcodec 58.101.100 / 58. 97.102
libavformat 58. 51.101 / 58. 49.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
WARNING: defaulting hwaccel_output_format to cuda for compatibility with old commandlines. This behaviour is DEPRECATED and will be removed in the future. Please explicitly set “-hwaccel_output_format cuda”.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘video.mp4’:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2020-06-16T07:52:56.000000Z
com.android.version: 10
Duration: 00:00:20.80, start: 0.000000, bitrate: 2032 kb/s
Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
creation_time : 2020-06-16T07:52:56.000000Z
handler_name : SoundHandle
Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 640x1280, 1942 kb/s, SAR 1:1 DAR 1:2, 23.54 fps, 24.17 tbr, 90k tbn, 180k tbc (default)
creation_time : 2020-06-16T07:52:56.000000Z
handler_name : VideoHandle
[h264_cuvid @ 0x5584f68810] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps8) failed
[h264_cuvid @ 0x5584f68810] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps10) failed
[h264_cuvid @ 0x5584f68810] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps12) failed
Stream mapping:
Stream #0:1 -> #0:0 (h264 (h264_cuvid) -> h264 (h264_nvenc))
Stream #0:1 -> #1:0 (h264 (h264_cuvid) -> h264 (h264_nvenc))
Error while opening decoder for input stream #0:1 : Generic error in an external library

Anyone from NVIDIA has anything to say? Your own device with the Dev kit does not work. This bad software or hardware wasted my 1 week now.

I’m also having problems…

[h264_cuvid @ 0x5582390aa0] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps8) failed -> CUDA_ERROR_INVALID_DEVICE: invalid device ordinal
[h264_cuvid @ 0x5582390aa0] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps10) failed -> CUDA_ERROR_INVALID_DEVICE: invalid device ordinal
[h264_cuvid @ 0x5582390aa0] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps12) failed -> CUDA_ERROR_INVALID_DEVICE: invalid device ordinal

Help appreciated