Le Blog Utux

HTTP 200 GET /

Windows + Kdenlive + NVENC - Part 1: Nvidia H264 & H265 Hardware encoders

Rédigé par uTux 4 commentaires

Kdenlive is a great software but I noticed a major drawback on the Windows version: render time that is really slow. For example, let's take a 45min H264 2560x1440 60fps video file and crop it to 1920x1080 ("Position and Zoom" effect on Kdenlive). Render time is about 1h15 on Kdenlive while it's only 15 minutes on Adobe Premiere Pro, the difference is insane. Why is the later so fast ? Spoiler: GPU rendering.

Logo kdenlive

Let's talk about how rendering works. Kdenlive use ffmpeg and MLT. The Windows version of Kdenlive is built with an embedded minimal ffmpeg that does not support GPU hardware acceleration, which is sad. Fortunately, it is possible to download the full version of ffmpeg and install it on Kdenlive, here is how to proceed.

Download

Installation

  • Run the kdenlive installer which is in fact a self-extracting archive. Extract the contents in a location, for example C:\Program Files\Kdenlive.
  • Extract ffmpeg-release-full-shared.7z to a temporary location, for example C:\Users\utux\Downloads.
  • Copy C:\Users\utux\Downloads\ffmpeg\bin\* to C:\Program Files\Kdenlive\bin\
  • Copy C:\Users\utux\Downloads\ffmpeg\presets\* to C:\Program Files\Kdenlive\share\ffmpeg\

Configuration

Start or restart Kdenlive then click Configuration > Run Config Wizzard. Check "Nvidia hardware acceleration" and make sure it is properly detected.

Kdenlive config wizard

The following render profiles show be available now:

  • NVENC H264 CBR
  • NVENC H264 VBR
  • NVENC H265 CBR
  • VAAPI Intel H264
  • VAAPI AMD H264

Try to render a project using one of these profiles and take a look at the Performance / GPU / Video Encode section in the Task Manager:

taskmgr

If the GPU Encode graph is low (20% or less) that means that Kdenlive is rendering Effects on the CPU (such as "Position and zoom"). See limitations below.

Limitations

  • Right now (Apr 2021) effects cannot be rendered by the GPU (at least on Windows). This may lead to frustrating situations where the GPU encoder only works at 20% and render is slow. I used to capture 1080p games in a 1440p desktop, then crop with the "Position and Zoom" effect, I changed that. Now I have set OBS Studio to record in 1080p, negating the need any transformation.
  • I could not make NVENC work for proxy clips, which is bad.
  • The Windows version of Kdenlive does not seems to support Movit aka "Experimental GPU processing" which add effects that can be rendered by the GPU. For example, instead of "Position and zoom" you can use "Pan and zoom (GPU)". You should try the Flatpak version (Linux).

4 commentaires

#1  - toufou a dit :

Thanks for sharing.

How can we know effects using GPU?

Thanks,
TouFou

Répondre
#2  - uTux a dit :

I assume that no effect can be GPU rendered right now.
In the Linux version, there is an option to enable "GPU playback", giving you access to GPU effects.

Répondre
#3  - leonardyan a dit :

My laptop has Intel HD Graphics 4600 and AMD Radeon HD 86*0M. I tried what you said but kdenlive ended up with none of HW encoder detected. Seems that VAAPI doesn't exist on windows. So, without an NVIDIA card, HW encoding is simply impossible in kdenlive on Windows for now.

Répondre
#4  - Hoerli a dit :

As jeudi already wrote, unfortunately this does not currently work with AMD GPUs.
With my 5700XT it does not work :(

Répondre

Écrire un commentaire

Quelle est le premier caractère du mot m87asbgj ?