Kdenlive/Development

From KDE Community Wiki

This page should guide the developer to a build environment and provide a general “getting started”.

Pre-requisites and Supported Platforms

Kdenlive is primarely developped on GNU/Linux. Supported distributions are :

  • Ubuntu 18.04 LTS Bionic Beaver
  • Arch Linux

Current development code (2018) requires Qt >= 5.7 , KF5, and MLT >= 6.6.0. If your distro does not provide a recent MLT, you will need to compile it by yourself, see Kdenlive KF5 development page.

It is recommended to uninstall the official kdenlive package since our version will replace it: On Ubuntu :

sudo apt-get remove kdenlive kdenlive-data

Installing dependencies

development tooling

You will need classical development tools (like git, gcc ...) but also cmake :

sudo apt install build-essential git cmake extra-cmake-modules libsm-dev

KDE Frameworks 5, based on Qt5

On Ubuntu the following packages will pull all the necessary dependencies:

sudo apt install libkf5archive-dev libkf5bookmarks-dev libkf5coreaddons-dev libkf5config-dev \
libkf5configwidgets-dev libkf5dbusaddons-dev libkf5kio-dev libkf5widgetsaddons-dev \
libkf5notifyconfig-dev libkf5newstuff-dev libkf5xmlgui-dev libkf5declarative-dev \ 
libkf5notifications-dev libkf5guiaddons-dev libkf5textwidgets-dev \
libkf5iconthemes-dev kdoctools-dev libkf5crash-dev libkf5filemetadata-dev  kio \
kinit kde-runtime qtdeclarative5-dev libqt5svg5-dev qml-module-qtquick-controls
Note: on slightly older Ubuntu (<= Xenial), the libkf5kio-dev package is called kio-dev

Multimedia stack

You will also need MLT >= 6.6.0, ffmpeg and frei0r plug-ins

sudo apt install libmlt++-dev libmlt-dev melt frei0r-plugins ffmpeg

Dependencies for I18N

To have kdenlive localised in a different language than EN, you should install the additional dependencies that are requiered for the specific script to fetch the translations:

sudo apt install ruby subversion gnupg2 gettext

Getting the source code

Cloning the git repo

The easiest way to get Kdenlive source code is to clone the git repo:

git clone git://anongit.kde.org/kdenlive.git

Selecting the branch

The development branch is currently in 'refactoring_timeline'. So to get the latest code:

cd kdenlive
git checkout refactoring_timeline

Building Kdenlive

Create a directory for the build :

mkdir build
cd build

To avoid problems with plugins and libraries, it is easier to install Kdenlive in /usr:

cmake .. -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr

To fetch the translations of the application :

make fetch-translations

Then create a symbolic link to the po directory :

cd ..
ln -s build/po/ po
cd build/

Then build and install:

 make -j5
 sudo make install

You can then start your compiled version by simple entering:

kdenlive

Some more detailed information if you also want to compile MLT to get the by yourself can be found on our KF5 development page.
You can also get some general info on the TechBase tutorial Building An Existing Application. You may also be interested in the other tutorials on TechBase.

IDE Setup

Pick your favourite!

Setting up KDevelop

Open KDevelop and go to Project > Open/Import project Then select the CMakeLists.txt file in the kdenlive source folder. You can now start hacking on Kdenlive!

Setting up QtCreator

After checking out Kdenlive from git—when working on refactoring, you may want to clone two copies, one with the next branch and another one on the refactoring branch—, you can open the CMakeLists.txt in QtCreator, which will load the project if cmake succeeds. If you run/debug Kdenlive, make sure that kdenlive and not kdenlive_render is selected as an active project.

If you let QtCreator restore the previous session (File > Session manager), it will remember the open documents. Environment variables (see below) can be set in Projects > Build Environment.

MLT documentation

Kdenlive uses MLT’s C++ API called mlt++. This API is not documented as it is simply a wrapper to C functions. For example, the documentation of Mlt::Consumer::position() can be found in framework/mlt_consumer.c:mlt_consumer_position(). The actual C function name is usually a combination of the class name and the function name, but can also be found by consulting mlt++/MltConsumer.cpp:position().

Environment variables

If kdenlive crashes on startup (e.g. in QtCreator) and shows a message like:

   kdenlive(24309) KXMLGUIClient::setXMLFile: cannot find .rc file "kdenliveui.rc" for component "kdenlive"

then you have to ensure the .rc file is found. If CMake is configured to install Kdenlive to /usr/local, the .rc file is put there, but when kdenlive is then run from the build directory, the KXMLGUIClient will not search there. Solution: Set the environment variable KDEDIRS to $KDEDIRS:/usr/local.

You can get more information about the paths that are checked by running kdenlive like this:

   strace build/src/kdenlive 2>&1 | grep kdenliveui.rc


Developer Mailing List

The kdenlive developer mailing list archives can be found here

A searchable archive of the kdenlive developer mailing list can be found here

Information on how to subscribe can be found here