< Kdenlive‎ | Development
Revision as of 08:58, 5 October 2015 by Ttguy (talk | contribs) (Compiling MLT with Qt5 support - where to get melt)

Working with Kdenlive on KF5

If you want to test the KF5 (KDE Frameworks 5, based on Qt5) version of Kdenlive, you need a distribution that provides a running KF5 environnment, like Kubuntu Vivid (15.04) preview releases.
The status of the refactoring development process can be found on Refactoring page

Compiling MLT with Qt5 support

The first step is to recompile MLT with Qt5 support.

First install dependencies, on ubuntu:

sudo apt-get install build-essential pkg-config \
 libavformat-dev libavdevice-dev frei0r-plugins-dev libgtk2.0-dev libexif-dev \
 libmovit-dev libsdl1.2-dev libsox-dev libxml2-dev \
 ladspa-sdk libcairo2-dev libswscale-dev qtscript5-dev libqt5svg5-dev \ 
 libqt5opengl5-dev libepoxy-dev libeigen3-dev libfftw3-dev

On OpenSuse 13.2, for MLT+Kdenlive (not very used to that system, please correct me):

zypper ar -f http://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_13.2 Qt5
zypper ar -f http://download.opensuse.org/distribution/13.2/repo/oss/ oss
zypper ar -f http://download.opensuse.org/source/distribution/13.2/repo/oss/ oss-src
zypper refresh
zypper si kdenlive libmlt
zypper install libqt5-qtscript-devel libqt5-qtsvg-devel \
 libQt5OpenGL-devel libQt5Concurrent-devel kplotting-devel \
 libQt5Test-devel kparts-devel knotifications-devel

Now obtain the source files for the melt project.

Get the latest release from https://github.com/mltframework/mlt/releases/latest. This shows the most recent release notes. Now scroll down to the end of the release note. You should see a minor section labelled "Downloads". This section contains two attachments; one for the zip sources, another for the tar.gz sources. Download one of them and unpack to some nice place in your file system. In this example the source was downloaded to ~/kdenlive/ creating a folder mlt-0.9.8

This page also has links to Melt releases http://www.mltframework.org/bin/view/MLT/ProjectNews

(<where and how to you download the melt source? Which version of the source? -ttguy>)

Then configure, enabling all components, selecting target install dir, and pointing to Qt5...

On ubuntu 15.04 (multiarch enabled):

./configure --enable-gpl --enable-gpl3 --prefix=$INSTALL_PREFIX \
 --qt-includedir=/usr/include/x86_64-linux-gnu/qt5 --qt-libdir=/usr/lib/x86_64-linux-gnu

While on ubuntu 14.10 or OpenSuse 13.2:

./configure --enable-gpl --enable-gpl3 --prefix=$INSTALL_PREFIX \
 --qt-includedir=/usr/include/qt5 --qt-libdir=/usr/lib64

Compile and install:

make install

And make sure it works:

melt myclip.mp4

As Dan Dennedy recently pointed out, the frei0r package, which contains many effects, sometimes causes crashes because 2 of its filters are usually compiled against Qt4, which conflicts with Qt5. The solution is to balcklist these 2 filters, by adding them in MLT's blacklist.txt file, found in:

$INSTALL_PREFIX/share/mlt/frei0r/blacklist.txt

Just add these lines to the file:

frei0r.facebl0r
frei0r.facedetect

Get the Qt5/KF5 branch of Kdenlive

  1. Get the sources:
    git clone git://anongit.kde.org/kdenlive.git

The master branch is the current development branch containing refactoring efforts.

Create a build directory:

cd kdenlive;mkdir build;cd build

Compile Kdenlive

You will need to install several Qt/KDE devel packages to successfully compile.

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

sudo apt-get install libkf5newstuff-dev libkf5notifications-dev libkf5notifyconfig-dev libkf5plotting-dev \
 extra-cmake-modules  kdoctools-dev libsm-dev libv4l-dev libav-tools cmake qtdeclarative5-dev

Then build Kdenlive with the following options (in your build dir):

export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib
export XDG_DATA_DIRS=$INSTALL_PREFIX/share:$XDG_DATA_DIRS:/usr/share
PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
make -j4 install

And test

$INSTALL_PREFIX/bin/kdenlive

Frameworks 5 packages are hard come by in current linux versions. Beta versions of Ubuntu/Kubuntu 15.04 are a safe bet for getting these packages. Consider installing a virtual Ubuntu/Kubuntu 15.04 for testing the frameworks branch.

A light virtualization option is using chroot, setting it up in a ubuntu/debian environment is as simple as:

sudo -s
apt-get install schroot debottstrap
debootstrap --arch amd64 vivid $CHROOTDIR http://us.archive.ubuntu.com/ubuntu/
cat << === >> /etc/schroot/chroot.d/vivid.conf
[vivid]
aliases=default
description=vivid
type=directory
profile=desktop
directory=$CHROOTDIR
users=$USER
===
schroot -c -p vivid

Installing a recent git version of FFmpeg for Kdenlive (optional)

The LibAV/FFmpeg libraries that do all the encoding/decoding stuff are evolving quickly, but distributions do not always provide a recent version of these libraries. If you want to benefit from the latest features / fixes from these libraries, here is a quick howto on installing a recent FFmpeg version for MLT/Kdenlive without touching your system's LibAV/FFmpeg official version. This howto provides details for FFmpeg, but can probably be easily adapted for LibAV if you have a preference.

  • Get the latest FFmpeg sources:
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
  • Compile FFmpeg with the "suffix" option. It means all FFmpeg programs/libraries will be renamed to use that suffix so that they do not mess up your system's official versions (in my exemple, the suffix is mlt, so ffplay will be called ffplaymlt). Choose the install prefix of your choice, but do not install in /usr. Here is a sample configure:
./configure --prefix=/usr/local --progs-suffix=mlt --build-suffix=mlt --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
  • Next, recompile MLT to use this special FFmpeg version. Just add these 2 parameters to the MLT configure, where avformat-shared points to the install prefix of your custom FFmpeg, and avformat-suffix is the suffix used in previous step:
--avformat-shared=/usr/local --avformat-suffix=mlt
  • Recompile Kdenlive and in the Kdenlive settings dialog, under environment, make sure to edit the FFmpeg and FFplay paths to your newly compiled versions (in my example it will be /usr/local/ffmpegmlt and /usr/local/ffplaymlt)

Content is available under Creative Commons License SA 4.0 unless otherwise noted.