mlt icon indicating copy to clipboard operation
mlt copied to clipboard

melt-7 fails to find h264_nvenc encoder (No capable devices found) on Arch Linux, even when standalone ffmpeg works perfectly.

Open SSYH opened this issue 1 month ago • 2 comments

Describe the bug melt-7 fails to find h264_nvenc encoder (No capable devices found) on Arch Linux, even when standalone ffmpeg works perfectly.

System Environment

  • OS: Arch Linux (Garuda, Hyprland)
  • GPU: NVIDIA GeForce RTX 3080
  • NVIDIA Driver: 580.95.05
  • Kdenlive Version: 25.08.3-2
  • MLT Version: mlt 7.34.1-1 (from extra repo) and mlt-git 7.34.1.r2.989d66fb-1 (from AUR)
  • FFmpeg Version: n8.0 (compiled with --enable-nvenc)

The Problem When attempting to render a project in Kdenlive using any nvenc preset, the render crashes immediately. The Kdenlive log shows:

[h264_nvenc @ 0x7fcf5c201ac0] No capable devices found
Rendering of ... .mp4 crashed

This error persists even when launching Kdenlive from a terminal.

Diagnostics & Troubleshooting The system's standalone ffmpeg can access h264_nvenc without any problems. The failure is happening only when melt-7 tries to call it.

Test 1: ffmpeg (Standalone) - SUCCESS The following command, which uses the same encoder, runs and completes successfully:

ffmpeg -v error -i /path/to/video.mp4 -c:v h264_nvenc -f null -

The NVIDIA driver, ffmpeg, and the nvenc library are all installed and working correctly.

Test 2: System Libraries - SUCCESS All libraries appear to be correctly installed and visible:

  • nvidia-smi: Shows the 3080 and driver correctly.
  • ffmpeg -encoders | grep nvenc: Correctly lists h264_nvenc, hevc_nvenc, and av1_nvenc.
  • ldconfig -p | grep libnvidia-encode: Correctly finds libnvidia-encode.so.1.

Test 3: melt-7 (Direct Query) - FAILURE When melt-7 is queried, it fails to list the nvenc consumers.

melt-7 -query "consumers" | grep nvenc
# (This command returns no output)

Test 4: mlt Package Integrity (Arch Linux specific) - FAILURE :

$ melt-7 -query "consumers" | grep nvenc
mlt_repository_init: failed to dlopen /usr/lib/mlt-7/libmltrtaudio.so
(librtaudio.so.7: cannot open shared object file: No such file or directory)

(This was fixed by removing mlt and compiling mlt-git from the AUR, but the primary "No capable devices found" bug remained.)

  1. Conclusion The system's ffmpeg works, but melt-7 cannot. This suggests a bug in how melt is initializing the ffmpeg libraries or the h264_nvenc module specifically.

System Environment

  • OS: Arch Linux (Garuda, Hyprland)
  • GPU: NVIDIA GeForce RTX 3080
  • NVIDIA Driver: 580.95.05
  • Kdenlive Version: 25.08.3-2
  • MLT Version: mlt 7.34.1-1 (from extra repo) and mlt-git 7.34.1.r2.989d66fb-1 (from AUR)
  • FFmpeg Version: n8.0 (compiled with --enable-nvenc)

SSYH avatar Nov 08 '25 19:11 SSYH

It is working for me in the Shotcut 25.10 Flatpak, which includes FFmpeg 8. So, this suggests it is a build issue although I cannot think of anything special needed to be done other than to build against FFmpeg that is built with nvenc.

ddennedy avatar Nov 08 '25 20:11 ddennedy

mlt_repository_init: failed to dlopen /usr/lib/mlt-7/libmltrtaudio.so (librtaudio.so.7: cannot open shared object file: No such file or directory)

Those messages are not important. MLT modules are optional and designed to possibly fail to load due to missing dependencies. RtAudio is not critical and used for audio output during playback when SDL2 is not used. It is not used for encoding with melt.

melt-7 -query "consumers" | grep nvenc

There is no "nvenc" MLT consumer. There is avformat that uses nvenc. Use melt color: -consumer avformat vcodec=list

I also tested the Shotcut 25.11.2 Snap, which is the same build as our portable and AppImages, also using MLT 7.34 and FFmpeg 8, and that worked too. My system is using nvidia driver 535.

ddennedy@KDE-Neon-2404:~/Videos$ shotcut.ffmpeg -v verbose -i test1.mp4 -c:v h264_nvenc nvenc.mp4
ffmpeg version n8.0-30-g71007e6c12 Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04.2)
  configuration: --disable-static --disable-doc --enable-gpl --enable-version3 --enable-shared --enable-runtime-cpudetect --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libopus --enable-libzimg --enable-libdav1d --enable-libaom --disable-decoder=libaom_av1 --enable-libwebp --enable-libsvtav1 --enable-libvmaf --enable-libpulse --prefix=/root/shotcut/Shotcut/Shotcut.app
  libavutil      60.  8.100 / 60.  8.100
  libavcodec     62. 11.100 / 62. 11.100
  libavformat    62.  3.100 / 62.  3.100
  libavdevice    62.  1.100 / 62.  1.100
  libavfilter    11.  4.100 / 11.  4.100
  libswscale      9.  1.100 /  9.  1.100
  libswresample   6.  1.100 /  6.  1.100
[h264 @ 0x58a14ed1f900] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf62.3.100
  Duration: 00:00:10.01, start: 0.000000, bitrate: 1591 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 1920x1080 [SAR 1:1 DAR 16:9], 1581 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 3 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[out#0/mp4 @ 0x58a14ed22380] No explicit maps, mapping streams automatically...
[vost#0:0/h264_nvenc @ 0x58a14ed56b80] Created video stream from input stream 0:0
[aost#0:1/aac @ 0x58a14f8a6a40] Created audio stream from input stream 0:1
File 'nvenc.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
[vost#0:0/h264_nvenc @ 0x58a14ed56b80] Starting thread...
[aost#0:1/aac @ 0x58a14f8a6a40] Starting thread...
[vf#0:0 @ 0x58a14ed77140] Starting thread...
[af#0:1 @ 0x58a14f931f80] Starting thread...
[vist#0:0/h264 @ 0x58a14ed55440] [dec:h264 @ 0x58a14ed5cb00] Starting thread...
[aist#0:1/aac @ 0x58a14ed54f40] [dec:aac @ 0x58a14f933980] Starting thread...
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x58a14ed1e700] Starting thread...
Press [q] to stop, [?] for help
[h264 @ 0x58a14ed5c080] Reinit context to 1920x1088, pix_fmt: yuv420p
[graph_-1_in_0:1 @ 0x7fbd8c002dc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:stereo
[graph -1 input from stream 0:0 @ 0x7fbd94002e80] w:1920 h:1080 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:1/1 csp:bt709 range:tv
[h264_nvenc @ 0x58a14ed55600] Loaded Nvenc version 12.1
[h264_nvenc @ 0x58a14ed55600] Nvenc initialized successfully
[h264_nvenc @ 0x58a14ed55600] 1 CUDA capable devices found
[h264_nvenc @ 0x58a14ed55600] [ GPU #0 - < NVIDIA GeForce RTX 4070 > has Compute SM 8.9 ]
[h264_nvenc @ 0x58a14ed55600] supports NVENC
Output #0, mp4, to 'nvenc.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf62.3.100
  Stream #0:0(und): Video: h264 (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 25 fps, 12800 tbn (default)
    Metadata:
      encoder         : Lavc62.11.100 h264_nvenc
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, delay 1024, 128 kb/s (default)
    Metadata:
      encoder         : Lavc62.11.100 aac
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[out#0/mp4 @ 0x58a14ed22380] Starting thread...
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x58a14ed1e700] EOF while reading input94.5kbits/s speed=12.1x elapsed=0:00:00.50    
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x58a14ed1e700] Terminating thread with return code 0 (success)
[vist#0:0/h264 @ 0x58a14ed55440] [dec:h264 @ 0x58a14ed5cb00] Decoder thread received EOF packet
[aist#0:1/aac @ 0x58a14ed54f40] [dec:aac @ 0x58a14f933980] Decoder thread received EOF packet
[aist#0:1/aac @ 0x58a14ed54f40] [dec:aac @ 0x58a14f933980] Decoder returned EOF, finishing
[aist#0:1/aac @ 0x58a14ed54f40] [dec:aac @ 0x58a14f933980] Terminating thread with return code 0 (success)
[af#0:1 @ 0x58a14f931f80] Filtergraph returned EOF, finishing
[af#0:1 @ 0x58a14f931f80] All consumers returned EOF
[vist#0:0/h264 @ 0x58a14ed55440] [dec:h264 @ 0x58a14ed5cb00] Decoder returned EOF, finishing
[vist#0:0/h264 @ 0x58a14ed55440] [dec:h264 @ 0x58a14ed5cb00] Terminating thread with return code 0 (success)
[vf#0:0 @ 0x58a14ed77140] Filtergraph returned EOF, finishing
[vf#0:0 @ 0x58a14ed77140] All consumers returned EOF
[aost#0:1/aac @ 0x58a14f8a6a40] [enc:aac @ 0x58a14f8a7140] Encoder thread received EOF
[af#0:1 @ 0x58a14f931f80] Terminating thread with return code 0 (success)
[aost#0:1/aac @ 0x58a14f8a6a40] Terminating thread with return code 0 (success)
[vf#0:0 @ 0x58a14ed77140] Terminating thread with return code 0 (success)
[vost#0:0/h264_nvenc @ 0x58a14ed56b80] [enc:h264_nvenc @ 0x58a14ed4a480] Encoder thread received EOF
[vost#0:0/h264_nvenc @ 0x58a14ed56b80] Terminating thread with return code 0 (success)
[out#0/mp4 @ 0x58a14ed22380] All streams finished
[out#0/mp4 @ 0x58a14ed22380] Terminating thread with return code 0 (success)
[AVIOContext @ 0x58a14fa19f40] Statistics: 1185476 bytes written, 2 seeks, 8 writeouts
[out#0/mp4 @ 0x58a14ed22380] Output file #0 (nvenc.mp4):
[out#0/mp4 @ 0x58a14ed22380]   Output stream #0:0 (video): 250 frames encoded; 250 packets muxed (1172014 bytes); 
[out#0/mp4 @ 0x58a14ed22380]   Output stream #0:1 (audio): 469 frames encoded (480256 samples); 470 packets muxed (4382 bytes); 
[out#0/mp4 @ 0x58a14ed22380]   Total: 720 packets (1176396 bytes) muxed
[out#0/mp4 @ 0x58a14ed22380] video:1145KiB audio:4KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.771509%
frame=  250 fps=0.0 q=16.0 Lsize=    1158KiB time=00:00:09.88 bitrate= 959.9kbits/s speed=14.1x elapsed=0:00:00.69    
[h264_nvenc @ 0x58a14ed55600] Nvenc unloaded
[aac @ 0x58a14f8a71c0] Qavg: 65239.750
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x58a14ed1e700] Input file #0 (test1.mp4):
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x58a14ed1e700]   Input stream #0:0 (video): 250 packets read (1977197 bytes); 250 frames decoded; 0 decode errors; 
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x58a14ed1e700]   Input stream #0:1 (audio): 470 packets read (4801 bytes); 469 frames decoded; 0 decode errors (480256 samples); 
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x58a14ed1e700]   Total: 720 packets (1981998 bytes) demuxed
[AVIOContext @ 0x58a14ed27180] Statistics: 1990088 bytes read, 0 seeks

Exiting with exit code 0

I just updated to nvidia driver 580, and that worked too.

ddennedy avatar Nov 09 '25 04:11 ddennedy