Installing from source code

Kdenlive is at the crossroads of several free software libraries providing multimedia services. Therefore, the compilation process is rather long. It makes sense to at least get the development version of MLT and ffmpeg as well since these projects (especially MLT) are closely connected. If you need some new effects from frei0r, SoX, or another resource, you may want to compile it as well.

Make sure to install the components in the right order (as listed here), and to complete each step before starting with the next one.

Please report any compilation problem on our Forum: Installing from source.

Installing from source is not recommended for basic users. If you don't understand how to compile and install a program, you might break things on your system, use at your own risks. This is a 5 steps procedure:

1 - Installing the required dependencies
2 - Installing FFmpeg (the multimedia library doing all hardcore processing)
3 - Installing Frei0r (a video library providing many of Kdenlive's effects)
4 - Installing MLT (the multimedia framework that does everything behind Kdenlive's interface)
5 - Installing Kdenlive


Installing required dependencies

Build Script

As an easier alternative to this manual procedure, there is a build script that gets the latest version of Kdenlive and many of its multimedia dependencies including x264, libvpx, FFmpeg, frei0r, MLT. Then, it builds them into an isolated folder in your home directory and does not require installation. Rather, when you run it with the provided launch script, it uses the more recent libraries and plugins instead of those from packages.

Packages and Version Numbers

Version numbers of the libraries may change. If you cannot find the exact name of a library, e.g. libpango1.0-dev, try searching for a different package starting with libpango and ending with -dev. Also sometimes a version number is necessary although it is not written here (e.g. the list below says libpango-dev, but the package is called libpango1.0-dev) — or also the other way round.

When installing packages in the terminal, e.g. with
apt-get install package1 package2 …
, the Tabulator key will be a great help: Type libpango and press Tab twice to see all possible packages.

One-liner

For easier installing, this is the list of the required libraries. They are explained below.

subversion git cmake build-essential yasm libqt4-dev kdelibs5-dev libsdl1.2-dev libsdl-image1.2-dev libxml2-dev libx264-dev libtheora-dev libxvidcore-dev libogg-dev libvorbis-dev libschroedinger-dev libmp3lame-dev libfaac-dev libfaad-dev libgsm1-dev libopencore-amrnb-dev libopencore-amrwb-dev libsamplerate0-dev libjack-dev libsox-dev ladspa-sdk swh-plugins libmad0-dev libpango1.0-dev libvpx-dev

General tools

To download the source code you will need to install Subversion and git.

  • subversion
  • git
  • cmake

Additionally required for compiling stuff:

  • build-essential
  • yasm modular assembler (for H.264 decoding)

General libraries

  • Qt 4 and KDE 4 development files (libqt4-dev and kdelibs5-dev)
  • SDL (libsdl1.2-dev, libsdl-image1.2-dev)
  • libXML2 (libxml2, libxml2-dev)

Screen capture

  • recordmydesktop

Firewire and DV capture

  • dvgrab
  • libdv (libdv4-dev)
  • libdc1394 (libdc1394-22-dev)

Audio and video codecs

  • x264 codecs (x264, libx264-dev)
  • Theora codecs (libtheora-dev)
  • Xvid codecs (libxvidcore-dev)
  • OGG (libogg-dev)
  • Vorbis (libvorbis-dev)
  • Dirac lossless codec (libschroedinger-dev)
  • Lame audio codec (libmp3lame-dev)
  • Libquicktime (libquicktime-dev)
  • faac codecs (libfaac-dev)
  • faad codecs (libfaad-dev)
  • GSM (libgsm, libgsm1-dev)
  • speech codecs (libopencore-amrnb-dev libopencore-amrwb-dev)

Sound processing and effects

  • libsamplerate (libsamplerate0-dev)
  • libJack (libjack-dev)
  • SOX (sox, libsox-dev)
  • ladspa (ladspa-sdk)
  • ladspa plugins (swh-plugins)
  • libmad (libmad0-dev)

Video effects and image processing

  • frei0r effects (frei0r-plugins, frei0r-plugins-dev) only if you do not intend to compile frei0r yourself!
  • gdk-pixbuf-dev
  • libpango1.0-dev

Warning

MLT relies on FFmpeg compilation parameters. If your distribution ships with an outdated FFmpeg version, it may not be able to use the audio and video codecs like H.264 or AVCHD. In this case, recompile FFmpeg with all needed options or ask FFmpeg packager to upgrade.

Please inform us of additional dependencies that we may have forgotten.


Installing FFmpeg

Installing FFmpeg packages

Most distributions provide packages for FFmpeg. The required packages for MLT compilation are:

  • ffmpeg
  • libavformat, libavformat-dev
  • libavutil, libavutil-dev,
  • libswscale, libswscale-dev,
  • libavcodec, libavcodec-dev,
  • libavdevice, libavdevice-dev

After installation, type ffmpeg to view ffmpeg compilation parameter, which must match our parameters (read below).

Compiling FFmpeg from sources

If your distribution does not provide a recent version of FFmpeg, it is recommended to compile FFmpeg from git. However you must be very careful to remove your distribution packages before installing the compiled ones, or you may be in trouble. Also remove any file from the Kdenlive installation wizard if you used it.

Install the needed libraries and make sure yasm assemby code compiler is installed.

Note on Ubuntu 10.10: ffmpeg requires libx264 of at least version 1.0 which is not in the repositories yet as of Jan 2011. Please follow this guide instead to install ffmpeg with H.264 support.

1. Get the source

Check out the ffmpeg source code from git into a new directory (called ffmpeg):

cd
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg

(If you get an error message that git cannot be found, you need to install the package git.)

Alternatively, you can use the new Libav:

cd
git clone git://git.libav.org/libav.git
cd libav

2. Configure ffmpeg

To configure ffmpeg with the recommended compilation flags (determine which formats can be encoded etc.):

./configure --prefix=/usr --enable-shared --enable-libmp3lame --enable-gpl --enable-libfaac --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-x11grab --enable-libgsm --enable-libx264 --enable-libtheora --enable-libdc1394 --enable-nonfree --disable-stripping --enable-avfilter --enable-libschroedinger --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libvpx

It is possible that you get some error messages here, like ERROR: libopencore_amrwb not found. In this case check whether the according library is really installed. If you cannot install it, delete the flag (in this case it would be --enable-libopencore-amrwb) from the above command and execute it again.

3. Compile and install ffmpeg

To compile and install ffmpeg, execute the following commands (still from the same directory):

make -j3
sudo make install

Compiling will take some time (possibly several minutes). After ffmpeg is installed you are ready to continue with MLT or, if desired, frei0r.

4. Optional: Updating ffmpeg

After some days/weeks you want to update your self-compiled copy of ffmpeg. To do so, first update the source code by running:

cd
cd ffmpeg
git pull

Then run

make clean

to get rid of previously compiled files and continue with steps 2 and 3.


Installing Frei0r

To compile the development version of frei0r, if you want to use an effect that is not available in a package. Make sure to first uninstall frei0r (frei0r-plugins, frei0r-plugins-dev, frei0r-plugins-doc for example) before installing the compiled version.

Libraries

Some additional libraries are required for frei0r.

  • libcv-dev
  • libgavl-dev
  • libhighgui-dev
  • libcvaux-dev

in a line libcv-dev libgavl-dev libhighgui-dev libcvaux-dev

Compiling and installing fei0r

In the terminal, check out the frei0r source code from the git repository:

cd
git clone git://git.dyne.org/frei0r.git

Then change to the frei0r directory and compile/install it:

cd frei0r
mkdir build
cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j3
sudo make install

Updating frei0r

To update frei0r to the current version, type:

cd
cd frei0r
git pull
rm -rf build && mkdir build
cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j3
sudo make install


Installing MLT

You can download the latests official release of MLT from http://mltframework.org.

But it is recommended to use the latest development version which contains bug fixes. This page explain how to compile and install this version from the source code. If you just want to use the latest MLT component but keep an official Kdenlive released, please read this: http://kevin.deldycke.com/2010/11/latest-stable-kdenlive-development-ver...

Remove MLT previous installation

You should uninstall previous versions of MLT very carefully. Warning: to remove MLT, you will need to connect under root account. There is a risk to destroy your operating system if you remove the wrong files.

  • Use your package installer to remove any mlt* and libmlt* packages.
  • Inspect /usr/local/lib and /usr/lib directories and look for mlt* and libmlt*. Remove files and directories if any.
  • Remove pkgconfig files (mlt-framework.pc, mlt-miracle.pc and mlt-valerie.pc). Remove the following files: /usr/lib/pkgconfig/libmlt*, /usr/local/lib/pkgconfig/libmlt*.

Install dependencies

Make sure you have the following packages installed:

  • libxml2-dev
  • libsdl-dev
  • libsdl-image-dev
  • libavdevice-dev
  • libswscale-dev
  • libvorbis-dev
  • libsamplerate-dev
  • frei0r-plugins-dev (must notbe installed you compiled frei0r from source)
  • libdv-dev
  • libavformat-dev
  • libquicktime-dev

We also recommand that you install:

  • libsox-dev
  • libjack-dev
  • ladspa-sdk

Get latest MLT source code

Git is used to track MLT code. You can checkout the latest version with the following command:

cd
git clone git://github.com/mltframework/mlt.git
cd mlt

To update your MLT copy later, you need to go into your mlt folder and run the following code to fetch the newest source code:

cd
cd mlt
git pull

Configure MLT

Before compiling, MLT needs to be configured (searches for libraries etc.):

./configure --prefix=/usr --enable-gpl

Or, if qimage module fails to configure, try:

./configure --prefix=/usr --enable-gpl --qimage-libdir=/usr/lib/ --qimage-includedir=/usr/include/qt4

Read configuration output and make sure all shared libraries are found.

Compile and install MLT

The last step. Compiling will take a long time.

make clean
make -j3
sudo make install

If you are not on Ubuntu, then use su -c 'make install' instead of sudo make install.

Get a specific MLT version

This is only necessary when you experience problems with the most recent MLT version. To list the available tags and select one (e.g. v0.4.6) do:
git tag -l
git checkout tag

To switch back to the most up-to-date version use master as tag. After checking out the tag you need to do a git pull again.


Installing Kdenlive

Stable release

Kdenlive latest stable release can be downloaded from the KDE servers. (release before 0.9 are still available on our SourceForge page).

Getting the latest source code

Alternatively, you can checkout the development of Kdenlive from the git server:

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

You can also browse source code online (Projects.kde.org | Quickgit).

If you want to build the current stable branch (0.9):

git checkout v0.9

Or to build the current development code:

git checkout master

Compiling and installing Kdenlive

Then, in the kdenlive directory, where the files have been downloaded to, type:

mkdir build; cd build; cmake .. -DCMAKE_INSTALL_PREFIX=/usr; make
sudo make install

Updating your sources to the latest version

To later update to latest version of the source code:

git pull

Then make and make install and previously described.