This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Simple kdenlive builter script - version 2.0

Tags: None
(comma "," separated)
espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Version 2.0 is out :)

- support for debugging

- fixes by Olo

- better ffmpeg configuration settings description

- revision number printing, last update date printing etc.

- svn update all modules support (more efficient than 'getsources')



NOTE:

Please ALWAYS call ./kdenlive_builder.sh clean prior to build.



#!/bin/bash
# Script for easy and SAFE Kdenlive & ffmpeg & mlt & mlt++ build utilizing LD_RUN_PATH
# All subprojects are compiled and installed to specified non-system directory.
# You can safely keep multiple kdenlive/ffmpeg versions.
#
# This sript ensures, that kdenlive will call only desired ffmpeg and mlt libs.
# Using LD_RUN_PATH is a better, more general, alternative to statically link it all together.
# You can verify this it by calling
# cd ~/build/kdenlive/bin && ldd ./kdenlive
# - or -
# cd ~/build/kdenlive/bin && LD_DEBUG=libs ./kdenlive
# Set DEST_DIR in script, otherwise ~/build/kdenlive is used by default.
#
# Espinosa, Olo
# v2.0 - 27.6.2007
# v2.1 - fixed SVN URL for Kdenlive (18.7.2007)
#
# Usage:
# kdenlive_builder getsources - call svn to get sources for all subprojects for the first time
# kdenlive_builder updatesources - call svn to update sources for all subprojects
# kdenlive_builder clean - call make clean for all subprojects
# kdenlive_builder build - call configure and make and make install for all subprojects
# kdenlive_builder info - print revision numbers and dates for each component


# Modify the destination directory if you want
# Or you can copy it afterwars to /opt/kdenlive- or wherever you want.
# Caution: if you pick /usr here, you system kdenlive, ffmpeg and mlt will be overwritten!
export DEST_DIR=~/build/kdenlive

case "$1" in

"getsources")
# Download sources of ffmpeg, mtl, mlt++, kdenlive from their SVNs
# Call this as a very first command, call it once, then use updatesources (quicker)
# Subdirectories are created by this command
svn co svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg &&
svn co https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt mlt &&
svn co https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++ mlt++ &&
svn co https://kdenlive.svn.sourceforge.net/svnroot/kdenlive/trunk/kdenlive
;;

"updatesources")
# The same as 'getsources' but quicker
# You must have already all sorces downloaded prior to call this!
cd ffmpeg &&
svn update &&
cd ../mlt &&
svn update &&
cd ../mlt++ &&
svn update &&
cd ../kdenlive &&
svn update
;;

"clean")
cd ffmpeg
make clean
cd ../mlt
make clean
cd ../mlt++
make clean
cd ../kdenlive
make clean
;;

"build")
export PATH=$DEST_DIR/bin:$PATH
export LD_RUN_PATH=../lib

cd ffmpeg &&

#
# FFmpeg configuration settings explained:
#
# Note: Most of the options mean that an external library is required! Remember, many codecs, especially audio codecs,
# are NOT implemented by FFmpeg, or the implementation is inferior.
#
# --enable-gpl .. enable GPLed libraries, like swscaller - ESSENTIAL, REQUIRED by MLT
# --enable-swscaler .. enable SW scaller, statically linked lib handled by ffmpeg but GPL - ESSENTIAL, REQUIRED by MLT
# --enable-libmp3lame .. support for mp3 audio codec - STRONGLY RECOMMENDED
# --enable-liba52 .. support for ACC (aka A52) audio codec used in DVDs - STRONGLY RECOMMENDED
# --enable-libogg .. support for OGG format - RECOMMENDED
# --enable-pp .. enable post processing of video - required??
# --enable-libtheora .. support for theora video codec by external lib - RECOMMENDED
# --enable-libvorbis .. support for theora video codec by external lib - RECOMMENDED
# --enable-libx264 .. support for high quality H264 codec, extern. lib - GOOD TO HAVE
# --enable-libfaad .. support for Advaced Audio codec - AAC (iPod, some mp4) - GOOD TO HAVE
# --enable-libfaac .. altern. support for Advaced Audio codec - AAC (iPod, some mp4) - GOOD TO HAVE
#
# --enable-vhook .. have no idea what is this good for, set on by default
# --enable-x11grab .. have no idea what is this good for, set on by default
#
# --enable-libgsm .. support for low bandwith GSM audio codec, mostly speach, not much used in movies
# --enable-xvid .. Xvid codec support is well handled by FFmpeg itself - NOT RECOMMENDED
# --enable-amr_nb .. support for audio codec, not widely used ?
# --enable-amr_wb .. support for audio codec, not widely used ?
# --enable-libdts .. support for audio? codec, not widely used ?
#
# --enable-debug .. DEBUGGING support is swith ON by default. For a final distribution wise version remove this paramater
#

./configure --prefix=$DEST_DIR \
--enable-gpl \
--enable-shared \
--enable-swscaler \
--enable-libogg \
--enable-pp \
--enable-libtheora \
--enable-libmp3lame \
--enable-libvorbis \
--enable-liba52 \
--enable-libx264 \
--enable-debug &&
make &&
make install &&

cd ../mlt &&
./configure --prefix=$DEST_DIR --enable-gpl --avformat-swscale --enable-motion-est --enable-mmx --enable-debug &&
make &&
make install &&


cd ../mlt++ &&
./configure --prefix=$DEST_DIR --enable-debug &&
make &&
make install &&


cd ../kdenlive &&
sh bootstrap &&
./configure --prefix=$DEST_DIR --enable-debug=full &&
make &&
make install
;;

"info")
# Print SVN revision number and udate date for each component
# Good to know when reporting an error
cd ffmpeg
echo "FFmpeg SVN version:"
svn info | grep '\(Revision\|Last\ Changed\ Date\)'
cd ../mlt
echo "MLT SVN version:"
svn info | grep '\(Revision\|Last\ Changed\ Date\)'
cd ../mlt++
echo "MLT++ SVN version:"
svn info | grep '\(Revision\|Last\ Changed\ Date\)'
cd ../kdenlive
echo "Kdenlive SVN version:"
svn info | grep '\(Revision\|Last\ Changed\ Date\)'
;;

*)
# print some help
echo 'Kdenlive & ffmpeg & mlt & mlt++ build script utilizing LD_RUN_PATH'
echo 'Set DEST_DIR in script, otherwise ~/build/kdenlive is used by default'
echo 'Usage: '
echo ' kdenlive_builder getsources - call svn to get sources for all subprojects for the first time'
echo ' kdenlive_builder updatesources - call svn to update sources for all subprojects'
echo ' kdenlive_builder clean - clean subdirs. Recommended to call prior to build'
echo ' kdenlive_builder build - build and instal all sources to user defined directory'
echo ' kdenlive_builder info - print revision numbers and dates for each component'
;;

esac

# Changelog:
# v1.0 - 16.6.2007
# initial version
# v2.0 - 27.6.2007
# support for debugging
# fixes by Olo
# better ffmpeg help
# revision number printing, etc.
#


UPDATE - 18.7.2007

v2.1 - fixed sourceforge SVN URL for Kdenlive (changed? when?)

Using the latest script from SVN is highly suggested

http://kdenlive-dev-helpers.googlecode. ... builder.sh

reinhard_drupal
Registered Member
Posts
66
Karma
0

Actually I have problems building ffmpeg using your script




ra@kubuntu-testbox:/prog/build$ ./kdenlive_builder.sh build
ERROR: x264 not found
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
ra@kubuntu-testbox:/prog/build$


I use kubuntu 7.04 and x264 is located here



ra@kubuntu-testbox:/usr/local/lib$ locate libx264
/var/lib/dpkg/info/libx264-dev.list
/var/lib/dpkg/info/libx264-dev.md5sums
/usr/share/doc/libx264-dev
/usr/share/doc/libx264-dev/changelog.Debian.gz
/usr/share/doc/libx264-dev/copyright
/usr/share/doc/libx264-dev/AUTHORS
/usr/lib/libx264_pic.a
/usr/lib/libx264.a
/prog/svn/mlt/trunk/mlt/src/modules/avformat/ffmpeg/libavcodec/.svn/prop-base/libx264.c.svn-base
/prog/svn/mlt/trunk/mlt/src/modules/avformat/ffmpeg/libavcodec/.svn/text-base/libx264.c.svn-base
/prog/svn/mlt/trunk/mlt/src/modules/avformat/ffmpeg/libavcodec/libx264.c
/prog/build/ffmpeg/libavcodec/.svn/prop-base/libx264.c.svn-base
/prog/build/ffmpeg/libavcodec/.svn/text-base/libx264.c.svn-base
/prog/build/ffmpeg/libavcodec/libx264.c
ra@kubuntu-testbox:/usr/local/lib$


Any idea?



btw - I would love to use such a script to install a stable version beside the development version!

Any plans for that?



btw2 - "./kdenlive_builder.sh clean" seems not to work after a fresh checkout since some files are not existent at this point ...



ra@kubuntu-testbox:/prog/build$ ./kdenlive_builder.sh clean
Makefile:5: config.mak: No such file or directory
/version.sh
make: /version.sh: Command not found
make: *** No rule to make target `config.mak'. Stop.
Makefile:26: config.mak: No such file or directory
make: *** No rule to make target `config.mak'. Stop.
Makefile:1: config.mak: No such file or directory
make: *** No rule to make target `config.mak'. Stop.
make: *** No rule to make target `clean'. Stop.
ra@kubuntu-testbox:/prog/build$


greetings )

reinhard



Always using latest svn versions of mlt, mlt++ and kdenlive (ubuntu).

jeevesbond
Registered Member
Posts
20
Karma
0

reinhard wrote:
I use kubuntu 7.04 and x264 is located here


Hmmm, locate on my system returns an: /usr/bin/x264 entry, are you certain you have it installed? Maybe you need the binary as well as the -dev package? failing that, you could just remove the --enable-libx264 line from the script.

reinhard wrote:
btw - I would love to use such a script to install a stable version beside the development version!

Any plans for that?


Hmmm, would this be needed? There're stable version binaries of Kdenlive (and MLT, for Ubuntu) available.

reinhard wrote:
btw2 - "./kdenlive_builder.sh clean" seems not to work after a fresh checkout since some files are not existent at this point ...


A clean will only work after a successful compile. :)

*** EDIT ***

Just tried this and x264 causes the same error for me too (on Kubuntu also). Just delete the --enable-libx264 from the ffmpeg ./configure line



espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Quote:
btw - I would love to use such a script to install a stable version beside the development version!

Any plans for that?


Indeed you can! I myself have stable 0.4 and SEVERAL versions of 0.5svn installed (all builded by kdenlive_builder).

This script was created exactly for this reason.

AD x264

You don't have libx264-dev installed (or incorrectly installed). You are missing a crucial file, the header file:

/usr/include/x264.h

But as was written, you can omit x264 support quite easily, it is a "nice to have", but since this codec is still not much widely used, and even the open source implementation is rather beta quality you can remove the option.

reinhard_drupal
Registered Member
Posts
66
Karma
0

jeevesbond wrote:
reinhard wrote:
btw - I would love to use such a script to install a stable version beside the development version!

Any plans for that?


Hmmm, would this be needed? There're stable version binaries of Kdenlive (and MLT, for Ubuntu) available.



Yes, but using your script I could create several stable kdenlive versions and stuff, the other way round, in a non-system directory which prevent conflicts with developer version which I actually install to /usr/local!

The other point is that I can create kdenlive directly after the release and don't have to wait for the official release of the distro's package maintainer. ;)

Also it's easy to tweak the compile options within your script to serve a special purpose!!

I think there should be a way to checkout stable branches by modify the checkout strings, right?

So finally there could be a special version of the script to create only stable versions?



But maybe this don't make sense? What do you mean :?:



greetings )

reinhard



Always using latest svn versions of mlt, mlt++ and kdenlive (ubuntu).

reinhard_drupal
Registered Member
Posts
66
Karma
0

espinosa_cz wrote:
Quote:
btw - I would love to use such a script to install a stable version beside the development version!

Any plans for that?


Indeed you can! I myself have stable 0.4 and SEVERAL versions of 0.5svn installed (all builded by kdenlive_builder).

This script was created exactly for this reason.

AD x264

You don't have libx264-dev installed (or incorrectly installed). You are missing a crucial file, the header file:

/usr/include/x264.h

But as was written, you can omit x264 support quite easily, it is a "nice to have", but since this codec is still not much widely used, and even the open source implementation is rather beta quality you can remove the option.



I'm sure I've checked that libx264-dev package (kubuntu) is installed, but I will check this again when back on a linux machine.

Can you please give some more information how do you modified your script to create the stable version ?



greetings )

reinhard



Always using latest svn versions of mlt, mlt++ and kdenlive (ubuntu).

espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Quote:
I'm sure I've checked that libx264-dev package (kubuntu) is installed, but I will check this again when back on a linux machine.



Then there is the right time to fill a bug report to Ubuntu bugzilla or whatever they use.

Check the Ubuntu forums first you may be not the first one having issues with this.

Note: I'm on SUSE.

Quote:


Can you please give some more information how do you modified your script to create the stable version ?


Stable version - you mean 0.4? I installed it from my distribution repository. (Packman additional repo to be precise)

There is a little problem with ffmpeg it lacks proper release management all distributions use SVN snapshots.

With mtl and kdenlive - yes they DO have release management.

Particular SVN revision is simply proclaimed as a stable release and you can retrieve this specified revision whenever you want, just modify the svn command, check man page for SVN. Or JB will branch it, splitting HEAD and STABLE_0_5 branches. Then you can retrieve source snapshot by name not a number :)



P.S.

Thank you for promoting the "Full Kdenlive Build" way with fresh MLT and FFmpeg. This is the way to get the right set of testers, to avoid problem with outdated or failing distribution versions.

espinosa_cz
Registered Member
Posts
118
Karma
0
OS

I have created a record about the script in kdenlive wiki in Getting_and_installing section. See:

http://en.wikibooks.org/wiki/Kdenlive/G ... installing

olo
Registered Member
Posts
72
Karma
0

Espinosa, I've started a new project on Google Code project hosting:



http://code.google.com/p/kdenlive-dev-helpers/



I've imported your script v.2.0 over there.



Do you have a Google account? If so, contact me at mailto:aleksander.adamowski@gmail.com and I'll give you necessary access to the project.



olo
Registered Member
Posts
72
Karma
0

vhof973 wrote:


...
make[2]: Entering directory `/home/val/kdenliveBuild/mlt/src/modules/sox'
cc -shared -o ../libmltsox.so factory.o filter_sox.o -lst `libst-config --libs` -L../../framework -lmlt
/usr/bin/ld: cannot find -lmad
collect2: ld returned 1 exit status
make[2]: *** [../libmltsox.so] Error 1


:idea: :?: :geek:



Look at the error message from the ld (the linker utility) - gcc received the instructions -lmad, which means to link with the mad library, but you probably don't have the necessary development package installed that would contain header files and libtool library files that are necessary for linking.



For Ubuntu Feisty, install libmad0-dev package.



olo
Registered Member
Posts
72
Karma
0

extremebob wrote:
Hi,

I've been trying to use this script to build kdenlive (on Fedora 7) but I am getting the following error when doing 'kdenlive_builder getsources':



svn: PROPFIND request failed on '/svnroot/kdenlive/trunk/kdenlive'

svn: PROPFIND of '/svnroot/kdenlive/trunk/kdenlive': Could not resolve hostname `svn.sourceforge.net': Host not found (https://svn.sourceforge.net)



Has sourceforge moved?



Yes, it has.



Always use the latest version of the kdenlive_builder.sh build script from http://code.google.com/p/kdenlive-dev-helpers/ .



olo
Registered Member
Posts
72
Karma
0

vhof973 wrote:
Another question,

now I'm running the compiled version-

root@val-desktop:~/build/kdenlive/bin# gksu kdenlive





Why are you doing anything as root? Apart from installing necessary libraries, you can do everything from an unprivileged account - build KDEnlive, use it and debug it, modify the source, rebuild and test your modifications. No need to use root at all.



vhof973 wrote:


kdenlive: +++++++++++ Generating scenelist start... ++++++++++++++++++

KCrash: Application 'kdenlive' crashing...



A stack trace that KCrash display would be more useful. But AFAIR, if you build KDEnlive with kdenlive_builder.sh, KCrash will not kick in - did you run the version built with kdenlive_builder.sh?



It would be better to disable KCrash and extract the stack trace using gdb:



1) run the kdenlive binary from gdb (GNU Debugger):




gdb /path/to/kdenlive
....
(gdb) run


2) after it crashes and gdb waits for your input, instruct it to show you the info about running threads at the moment of the crash:




(gdb) info threads


3) and the call stack (stacktrace / backtrace) for all the threads is necessary:


(gdb) thread apply all bt


The call stack will be human readable only if you compiled KDEnlive with debug symbols - the kdenlive_builder.sh script does that.



At this moment you can usually spot where the crash comes from in KDEnlive source code and have a look at the problematic fragment by yourself, and try to fix it (C++ knowledge required).



olo
Registered Member
Posts
72
Karma
0

extremebob wrote:


...


filter_sox.c:228:43: error: missing binary operator before token "("


...



I guess this must be something to do with my c preprocessor, but I'm not a linux or C expert. Can anyone help? I have gcc version 4.1.2 20070502 (Red Hat 4.1.2-12) if that's any help.



In my case it's cpp-4.1.2:




$ dpkg -S `which cpp`
cpp: /usr/bin/cpp
$ dpkg -l cpp
...
||/ Name Version Description
+++-==============-==============-============================================
ii cpp 4.1.2-1ubuntu1 The GNU C preprocessor (cpp)


However, it might be a problem with the particular MLT revision from that day - remember, we're using SVN versions, they might not compile. Simply wait till the next day, update your sources and try again...



olo
Registered Member
Posts
72
Karma
0

vhof973 wrote:
yes, I compiled everything with kdenlive_builder.sh, but I'll check again this problem :geek:


BTW, you may find this KDEnlive debug HOWTO useful:



http://code.google.com/p/kdenlive-dev-h ... ngKDEnlive



espinosa_cz
Registered Member
Posts
118
Karma
0
OS

TO ALL

You have to change directory to ~/build/kdenlive PRIOR you launch kdenlive binary!



If you run kdenlive like ~/build/kdenlive/bin/kdenlive it will most probably break. Beacause it will not find the compiled libraries or will try to run against older system ones, probably incompatible.



Explanation:

The library paths (mlt, ffmpeg) are relative, but to user current directory, not the directory where is the binary (the exe file). There is a detailed instruction how to test linker runtime behavior in these forums.



Unfortunatelly I don't know how to instruct the build proces to treat relative paths as relative to binary location not to a current directory :( Until this is solved you need change directory to ~/build/kdenlive first when launching from command line.



There are many workarounds:

- create a bash wrapper

- set LD_LIBRARY_PATH

but any is ideal.



Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], Yahoo [Bot]