Kdenlive/Development: Difference between revisions

From KDE Community Wiki
m (→‎KDE Frameworks 5, based on Qt5: removing trailing space)
(43 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Kdenlive is rather easy to build (at least on supported platforms), and this page should show you the simple steps to get there. If you encounter any problem during the process or spot any information that should be added/updated, please don't hesitate to reach out to the [[#Developer_Mailing_List| Developper's mailing list]].
Kdenlive is rather easy to build (at least on supported platforms), and this page should show you the simple steps to get there. If you encounter any problem during the process or spot any information that should be added/updated, please don't hesitate to reach out to the [[#Developer_Mailing_List| Developer's mailing list]] or on the [https://t.me/kdenlive_dev Telegram Kdenlive Developers' group] .


== Pre-requisites and Supported Platforms ==
== Pre-requisites and Supported Platforms ==


Kdenlive is primarely developped on GNU/Linux. There is an effort to  [[Kdenlive/Development/WindowsBuild|build Kdenlive on Microsoft Windows]], but it's still a work in progress.
Kdenlive is primarily developed on GNU/Linux. There is an effort to  [[Kdenlive/Development/WindowsBuild|build Kdenlive on Microsoft Windows]], but it's still a work in progress.


Supported distributions are :  
Currently supported distributions are:


* Ubuntu 18.04 LTS Bionic Beaver (and derivatives)
* Ubuntu 19.10 Eoan Ermine and derivatives
* Arch Linux
* Arch Linux


Current development code (2018) requires '''Qt >= 5.7''' , KF5, and '''MLT >= 6.6.0''', which are provided as package by the supported platforms. Any distribution that provides these dependencies should be a good start.
You should be able to build it on any platform that provides up to date versions of the following dependencies  '''Qt >= 5.7''', '''KF5 >= 5.50''','''MLT >= 6.20.0'''.


If your distro does not provide a recent MLT, you will need to compile it by yourself, see [[Kdenlive/Development/KF5|Kdenlive KF5 development page]].
To get a recent enough version fo mlt on Ubuntu, you have to add [https://launchpad.net/~kdenlive/+archive/ubuntu/kdenlive-master Kdenlive's ppa]
It is recommended to uninstall the official kdenlive package since our version will replace it.


<pre>
<pre>
sudo apt-get remove kdenlive kdenlive-data
sudo add-apt-repository ppa:kdenlive/kdenlive-master
sudo apt-get update
</pre>
</pre>


== Installing dependencies ==
== Installing dependencies ==
It is recommended to uninstall the official kdenlive packages to avoid potential conflicts.
<pre>
sudo apt remove kdenlive kdenlive-data
</pre>


=== Development tooling ===
=== Development tooling ===
Line 37: Line 42:
libkf5configwidgets-dev libkf5dbusaddons-dev libkf5kio-dev libkf5widgetsaddons-dev \
libkf5configwidgets-dev libkf5dbusaddons-dev libkf5kio-dev libkf5widgetsaddons-dev \
libkf5notifyconfig-dev libkf5newstuff-dev libkf5xmlgui-dev libkf5declarative-dev \
libkf5notifyconfig-dev libkf5newstuff-dev libkf5xmlgui-dev libkf5declarative-dev \
libkf5notifications-dev libkf5guiaddons-dev libkf5textwidgets-dev \
libkf5notifications-dev libkf5guiaddons-dev libkf5textwidgets-dev libkf5purpose-dev \
libkf5iconthemes-dev kdoctools-dev libkf5crash-dev libkf5filemetadata-dev  kio \
libkf5iconthemes-dev kdoctools-dev libkf5crash-dev libkf5filemetadata-dev  kio \
kinit kde-runtime qtdeclarative5-dev libqt5svg5-dev qml-module-qtquick-controls
kinit qtdeclarative5-dev libqt5svg5-dev qml-module-qtquick-controls \
qtmultimedia5-dev qtquickcontrols2-5-dev
</pre>
</pre>
<div style="background:#F5F5DC">Note: on slightly older Ubuntu (<= Xenial), the libkf5kio-dev package is called kio-dev</div>


=== Multimedia stack ===
=== Multimedia stack ===


You will also need MLT >= 6.6.0, ffmpeg and frei0r plug-ins
If your distribution packages a recent enough version of  MLT (>= 6.20.0), you can install it directly along with ffmpeg and frei0r plug-ins. Otherwise, you'll have to add our ppa or compile it yourself (see above)


<pre>
<pre>
Line 52: Line 56:
</pre>
</pre>


=== Dependencies for localisation ===
=== Dependencies for localization ===


To have kdenlive localised in a different language than EN, you should  install the additional dependencies that are required by the specific script to fetch the translations:  
There are some additional dependencies required by the specific script to fetch the translations:  
<pre>
<pre>
sudo apt install ruby subversion gnupg2 gettext
sudo apt install ruby subversion gnupg2 gettext
Line 65: Line 69:


<pre>
<pre>
git clone git://anongit.kde.org/kdenlive.git
git clone https://invent.kde.org/multimedia/kdenlive
</pre>
</pre>


=== Selecting the  branch ===
=== Selecting the  branch ===


It is important to understand that there is currently two main branches in Kdenlive code base:
You should generally base your developments on the master branch
 
* The  "refactoring_timeline" branch, which is where happens most of the development effort. The code base has undergone a massive cleanup and it should be much more fun to hack on. This is the one to choose by default.
* The stable branch, "Applications/18.04", which is mostly in maintenance mode: it should be of interest to you if you want to fix a small specific bug.


<pre>
<pre>
cd kdenlive
cd kdenlive
git checkout refactoring_timeline
git checkout master
</pre>
</pre>


or
or if you want to get the code for a given release


<pre>
<pre>
cd kdenlive
cd kdenlive
git checkout Applications/18.04
git checkout release/20.04
</pre>
</pre>


==  Building Kdenlive ==
==  Building Kdenlive ==
Create a directory for the build :
Create a directory for the build inside the kdenlive directory:


<pre>
<pre>
Line 98: Line 99:


<pre>
<pre>
cmake .. -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr
cmake .. -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr -DRELEASE_BUILD=OFF
</pre>
</pre>
Alternately you can build it with debug flags (advanced users only ;-)  and you need to have clang installed ) :
<pre>
cmake .. -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DECM_ENABLE_SANITIZERS='address' \
-DBUILD_TESTING=ON -DBUILD_FUZZING=ON -DBUILD_COVERAGE=OFF \
-DRELEASE_BUILD=OFF
</pre>
You may get a warning "Qt5 WebKitWidgets not found. You cannot use your Freesound.org credentials, only preview files can be downloaded from the Online Resources Widget": as this is a very specific feature requiring a rather large dependency, you can just ignore it. But if you want to use that feature, you must install libqt5webkit5-dev.


To fetch the translations of the application :
To fetch the translations of the application :
Line 106: Line 122:
</pre>
</pre>


This should create a po sub-directory in your build directory. You have then to create a symbolic link to this po sub directory :  
This should create a po sub-directory in your build directory. You have then to create a symbolic link to this po subdirectory :  


<pre>
<pre>
Line 116: Line 132:
Then build and install:
Then build and install:
<pre>
<pre>
make -j5
make -j5
sudo make install
sudo make install
</pre>
</pre>


You can then start your compiled version by simple entering:
You can then start your compiled version by simply entering:
<pre>
<pre>
kdenlive
kdenlive
</pre>
If you have compiled it in debug mode, you may encounter errors like
<pre>
SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/bin/kdenlive+0x643020)
==6982==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
==6982==ABORTING
</pre>
As the hint says, the you can solve this with
<pre>
export ASAN_OPTIONS=new_delete_type_mismatch=0
</pre>
</pre>


== Next Steps ==
== Next Steps ==


Now that you've got a working dev environment, you can head to [[https://phabricator.kde.org/project/profile/40/ Kdenlive's page on KDE's phabricator]]
Now that you've got a working dev environment, you can head to [[https://invent.kde.org/kde/kdenlive/-/issues?label_name%5B%5D=Junior+Job some nice first issues to solve]]


You can also get some general info on the TechBase tutorial [https://techbase.kde.org/Development/Tutorials/Building_An_Existing_Application Building An Existing Application]. You may also be interested in the other [https://techbase.kde.org/Development/Tutorials tutorials on TechBase].
You can also get some general info on the TechBase tutorial [https://techbase.kde.org/Development/Tutorials/Building_An_Existing_Application Building An Existing Application]. You may also be interested in the other [https://techbase.kde.org/Development/Tutorials tutorials on TechBase].
Line 154: Line 182:
You can get more information about the paths that are checked by running kdenlive like this:
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
     strace build/src/kdenlive 2>&1 | grep kdenliveui.rc
== Wayland ==
To avoid flickering here are some Kdenlive envvars that work with Sway?
<pre>
QT_QPA_PLATFORM=wayland-egl
SDL_VIDEODRIVER=wayland
XDG_SESSION_TYPE=wayland
</pre>
== Contact ==
==== Telegram ====
* [https://t.me/kdenlive Main group]
* [https://t.me/kdenlive_dev Developer group]




== Developer Mailing List ==
=== Mailing List ===
The kdenlive developer mailing list archives can be found [http://mail.kde.org/pipermail/kdenlive/ here]
The kdenlive developer mailing list archives can be found [http://mail.kde.org/pipermail/kdenlive/ here]



Revision as of 12:46, 13 June 2020

Kdenlive is rather easy to build (at least on supported platforms), and this page should show you the simple steps to get there. If you encounter any problem during the process or spot any information that should be added/updated, please don't hesitate to reach out to the Developer's mailing list or on the Telegram Kdenlive Developers' group .

Pre-requisites and Supported Platforms

Kdenlive is primarily developed on GNU/Linux. There is an effort to build Kdenlive on Microsoft Windows, but it's still a work in progress.

Currently supported distributions are:

  • Ubuntu 19.10 Eoan Ermine and derivatives
  • Arch Linux

You should be able to build it on any platform that provides up to date versions of the following dependencies Qt >= 5.7, KF5 >= 5.50,MLT >= 6.20.0.

To get a recent enough version fo mlt on Ubuntu, you have to add Kdenlive's ppa

sudo add-apt-repository ppa:kdenlive/kdenlive-master
sudo apt-get update

Installing dependencies

It is recommended to uninstall the official kdenlive packages to avoid potential conflicts.

sudo apt remove kdenlive kdenlive-data

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 libkf5purpose-dev \
libkf5iconthemes-dev kdoctools-dev libkf5crash-dev libkf5filemetadata-dev  kio \
kinit qtdeclarative5-dev libqt5svg5-dev qml-module-qtquick-controls \
qtmultimedia5-dev qtquickcontrols2-5-dev

Multimedia stack

If your distribution packages a recent enough version of MLT (>= 6.20.0), you can install it directly along with ffmpeg and frei0r plug-ins. Otherwise, you'll have to add our ppa or compile it yourself (see above)

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

Dependencies for localization

There are some additional dependencies required by 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 https://invent.kde.org/multimedia/kdenlive

Selecting the branch

You should generally base your developments on the master branch

cd kdenlive
git checkout master

or if you want to get the code for a given release

cd kdenlive
git checkout release/20.04

Building Kdenlive

Create a directory for the build inside the kdenlive directory:

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 -DRELEASE_BUILD=OFF

Alternately you can build it with debug flags (advanced users only ;-) and you need to have clang installed ) :

cmake .. -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DECM_ENABLE_SANITIZERS='address' \
-DBUILD_TESTING=ON -DBUILD_FUZZING=ON -DBUILD_COVERAGE=OFF \
-DRELEASE_BUILD=OFF


You may get a warning "Qt5 WebKitWidgets not found. You cannot use your Freesound.org credentials, only preview files can be downloaded from the Online Resources Widget": as this is a very specific feature requiring a rather large dependency, you can just ignore it. But if you want to use that feature, you must install libqt5webkit5-dev.


To fetch the translations of the application :

make fetch-translations

This should create a po sub-directory in your build directory. You have then to create a symbolic link to this po subdirectory :

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 simply entering:

kdenlive

If you have compiled it in debug mode, you may encounter errors like

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/bin/kdenlive+0x643020) 
==6982==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
==6982==ABORTING

As the hint says, the you can solve this with

export ASAN_OPTIONS=new_delete_type_mismatch=0

Next Steps

Now that you've got a working dev environment, you can head to [some nice first issues to solve]

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

Wayland

To avoid flickering here are some Kdenlive envvars that work with Sway?

QT_QPA_PLATFORM=wayland-egl
SDL_VIDEODRIVER=wayland
XDG_SESSION_TYPE=wayland

Contact

Telegram


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