0

I'm trying to transcode an mp4 video to hevc nvenc using the following command:

ffmpeg -i test.mp4 -c:v hevc_nvenc output.mkv

But I keep getting the error shown at the end of this post. I'm using an RTX 3060 laptop GPU, which is shown to support HEVC encoding and decoding in this website : https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new.

I've tried transcoding to h.264 nvenc, and with h.265 without nvenc, using the command lines:

ffmpeg -i test.mp4 -c:v h264_nvenc -c:a copy output.mkv

ffmpeg -i input.mp4 -c:v libx265 -c:a copy output.mkv

and they both worked, so it seems the problem is only hevc nvenc.

Here is the output for hevc nvenc, any help would be greatly appreciated:

  built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      59. 31.100 / 59. 31.100
  libavcodec     61. 11.100 / 61. 11.100
  libavformat    61.  5.101 / 61.  5.101
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.16.100
  Duration: 00:02:06.60, start: 0.000000, bitrate: 4153 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 4014 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)
      Metadata:
        handler_name    : ISO Media file produced by Google Inc.
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
      Metadata:
        handler_name    : ISO Media file produced by Google Inc.
        vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[hevc_nvenc @ 00000147092cb0c0] Codec not supported
[hevc_nvenc @ 00000147092cb0c0] No capable devices found
[vost#0:0/hevc_nvenc @ 000001470929e980] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 00000147092cb440] Error sending frames to consumers: Generic error in an external library
[vf#0:0 @ 00000147092cb440] Task finished with error code: -542398533 (Generic error in an external library)
[vf#0:0 @ 00000147092cb440] Terminating thread with return code -542398533 (Generic error in an external library)
[vost#0:0/hevc_nvenc @ 000001470929e980] Could not open encoder before EOF
[vost#0:0/hevc_nvenc @ 000001470929e980] Task finished with error code: -22 (Invalid argument)
[vost#0:0/hevc_nvenc @ 000001470929e980] Terminating thread with return code -22 (Invalid argument)
[out#0/matroska @ 00000147090f37c0] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A
Conversion failed!

1 Answers1

0

Can you try this command:

ffmpeg -v 0 -encoders | findstr "nvenc"

On my rig, I get this output:

V....D av1_nvenc            NVIDIA NVENC av1 encoder (codec av1)
V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
V....D hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)

This would at least confirm that your ffmpeg has these encoders present.