Render Kdenlive Projects on Headless Linux Server
This guide explains how to use Kdenlive’s “Generate Script” feature to render video projects on a remote, headless Linux server. By exporting a rendering script and the project’s MLT XML file from your desktop, you can offload the CPU-intensive rendering process to a dedicated command-line environment using the MLT framework.
Step 1: Generate the Rendering Script in Kdenlive
Before moving to your headless server, you must generate the rendering script using the Kdenlive GUI on your local machine.
- Open your project in Kdenlive.
- Click the Render button in the top toolbar (or
press
Ctrl + Enter). - Select your desired output format, quality, and encoder settings.
- Instead of clicking “Render to File”, click the Generate Script button at the bottom of the render dialog.
- Choose a destination folder and save the script. Kdenlive will
generate two essential files: a shell script (
.sh) and a project description file (.mltor.xml).
Step 2: Prepare the Headless Linux Server
Your headless server needs the MLT multimedia framework installed, as
Kdenlive relies on the melt command-line utility to process
renders.
Connect to your server via SSH.
Update your package manager and install
melt(along with any necessary codecs). On Debian/Ubuntu-based systems, run:sudo apt update sudo apt install melt kdenlive-data ffmpegNote: Installing the full
kdenlivepackage on a headless server is usually unnecessary, but installingmeltis required.
Step 3: Transfer Files to the Server
You must transfer the project files, the source assets, and the generated scripts to the headless server.
- Transfer your source footage, audio files, and images to the server.
- Transfer the
.shscript and the accompanying XML/MLT file. - Important: Keep the directory structure identical
to your local machine, or open the XML file and the
.shscript in a text editor to update the file paths of your source assets to match their new location on the server.
Step 4: Execute the Render Script
Once the files are on the server and paths are verified, you can start the rendering process.
Navigate to the directory containing your transferred script:
cd /path/to/your/render/folderMake the generated shell script executable:
chmod +x render_script.shRun the script:
./render_script.sh
Troubleshooting: Virtual Framebuffers
Because Kdenlive and MLT sometimes require visual libraries (like Qt) to initialize certain effects, the script might fail on a strictly headless server without a display server.
If you encounter display-related errors, install xvfb (X
Virtual Framebuffer) to simulate a graphical display in the
background:
sudo apt install xvfb
xvfb-run ./render_script.shThis commands wraps the rendering process in a virtual display environment, allowing the command-line render to complete successfully.