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

Simple build script for kdenlive + ffmpeg + mlt - use it!

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

This is a script I use for downloading sources and building kdenlive + ffmpeg + mlt and there is no reason why not to share it with others.

I can only recommend to anyone to use this script. It's suggested to have self compiled latest ffmpeg and mlt when you are going to report a bug.

IMPORTANT: The script force kdenlive to look for its libraries primarily in local ../lib subdirectory. You don't need to set LD_LIBRARY_PATH anymore.

IMPORTANT: The script will not interfere with any installed ffmpeg or mlt or kdenlive from you distribution. everything is builded into separate directory.

I suggest kdenlive_builder.sh as a name for the script.

Put the script to your source root directory and run it!

You don't need to modify PATH. After successful compilation go into destination directory, ~/build/kdenlive, into bin directory, and run ./kdenlive.




#!/bin/bash
# Script for easy Kdenlive & ffmpeg & mlt & mlt++ build utilizing LD_RUN_PATH
# All subprojects are compiled and installed to specified directory.
# This sript ensures, that kdenlive will call
# You can verify this it by calling
# cd ~/build/kdenlive/bin && ldd ./kdenlive
# - or -
# cd ~/build/kdenlive/bin && LD_DEBUG=libs ./kdenlive
# You can safely have multiple kdenlive/ffmpeg versions.
# Set DEST_DIR in script, otherwise ~/build/kdenlive is used by default.
#
# Espinosa
# v1.0 - 16.6.2007
#
# Usage:
# kdenlive_builder getsources - call svn to get 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
#

# 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")
cd ffmpeg
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ../mlt
svn co https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt mlt
cd ../mlt++
svn co https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++ mlt++
cd ../kdenlive
svn co https://svn.sourceforge.net/svnroot/kdenlive/trunk/kdenlive
;;

"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 &&

# from kdenlive: wiki
#./configure --prefix=$DEST_DIR --enable-gpl --enable-shared --enable-libvorbis --enable-libogg --enable-pp --enable-swscaler &&

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

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


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


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

*)
# 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'
echo ' kdenlive_builder clean'
echo ' kdenlive_builder build'
;;

esac


The script is very simple, it tests nothing! You are expected to have all necessary external libs already installed prior to execution of this script.

Check kdenlive requirements at http://en.wikibooks.org/wiki/Kdenlive/G ... g_from_SVN.



Please report problems related to script here.

Feel free to comment, improve the script or discuss configuration parameters used here.

Advices from more experienced "bashists" are welcomed.

espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Do you have mad (MPEG Audio Decoder) library and dev package installed? What version?

http://en.wikipedia.org/wiki/MPEG_Audio_Decoder

http://www.underbit.com/products/mad/



Can you post be back full path to your libmad?

Mine is /usr/lib/libmad.so.0.2.1 and this is fine.

And also check if you have:

/usr/include/mad.h



Hmm, may be MAD is just not mentioned in requirements in wiki.



P.S.

You can omit MAD library from ffmpeg ./configure params, it is easy to locate the line in script. But I would suggest to keep it if possible.

espinosa_cz
Registered Member
Posts
118
Karma
0
OS

OK, can you go to kdenlive src subdirectory and call one by one these commands?


sh bootstrap
./configure --prefix=$DEST_DIR
make
make install


It's also good to call clean (kdenlive_builder clean) for all directories prior to start building.



Hmm I don't know if you have to call bootstrap if we retrieving sources from SVN and not CVS. Isn't it just an outdated information in wiki?

Mine version of autoconf is 2.60.



Try to ommit the bootstrap script and then see what happens :)

olo
Registered Member
Posts
72
Karma
0

Posting reply in this thread as you requested.



espinosa_cz wrote:


??

What is you directory structure of kdenlive and its subproject? They are in separate directories aren't they?

kdenlive_builder suppose this structure:

/kdenlive
/ffmpeg
/mlt
/mlt++




That's correct, but in the ckeckout phase it's not good to cd into them, as you'll get a structure of:

/kdenlive/kdenlive
/ffmpeg/ffmpeg
/mlt/mlt
/mlt++/mlt++


That's because of how you invoke svn checkout. Additionally, if the dirs don't exist, they will be created during checkout, anyway and cd to them will fail beforehand.



Anyway, with those cd's the script didn't work, after getting rid of them all went fine, including build process.



espinosa_cz
Registered Member
Posts
118
Karma
0
OS

olo wrote:


That's correct, but in the ckeckout phase it's not good to cd into them, as you'll get a structure of:

/kdenlive/kdenlive
/ffmpeg/ffmpeg
/mlt/mlt
/mlt++/mlt++




OK. You are right.

I will fix it.

Thank you!
jeevesbond
Registered Member
Posts
20
Karma
0

leoon wrote:


result:

Bootstrap is now trying to create a ./configure script suitable for Kdenlive
WARNING: running bootstrap is only usefull when checking out Kdenlive from CVS.

./admin/cvs.sh: 651: --version: not found
*** AUTOCONF NOT FOUND!.
*** KDE requires autoconf 2.53 or newer
make: *** [cvs] Error 1


This is really annoying me: I had exactly this error a couple of months ago, but am not sure what I had to do to fix it!



Try running this:

sudo aptitude install kdelibs4-dev libqt4-dev unsermake libsdl-image1.2 libsdl-image1.2-dev libsdl1.2-dev libsamplerate0 libsamplerate0-dev libogg0 libogg-dev libvorbis0a libvorbis-dev libdv4 libdv4-dev libjack0.100.0-0 libjack0.100.0-dev sox sox-dev libxml2 libxml2-dev ladspa-sdk-dev libquicktime0 libquicktime-dev libtheora0 libtheora-dev ladspa-sdk swh-plugins libavformat0d libavformat-dev kdesvn build-essential libgtk2-dev libmad0 libmad0-dev autoconf automake1.9 dvgrab cvs subversion k3b dvdauthor



Those are all the dependencies you might need, I think that error appears if you don't have the 'unsermake' package installed, not certain about that though. :)



jeevesbond
Registered Member
Posts
20
Karma
0

Tried this script, without the cd's and using the commented out ./configure from the kdenlive wiki (for ffmpeg). When running the ffmpeg generated by this script all I get is:



liam@howardmoon:~$ ~/build/kdenlive/bin/ffmpeg
FFmpeg version SVN-r9415, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/home/liam/build/kdenlive --enable-gpl --enable-shared --enable-libvorbis --enable-libogg --enable-swscaler --enable-libmp3lame --enable-libtheora
libavutil version: 49.4.1
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Jun 24 2007 17:44:21, gcc: 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
usage: ffmpeg [[infile options] -i infile]... {[outfile options] outfile}...
Hyper fast Audio and Video encoder

Main options:
/home/liam/build/kdenlive/bin/ffmpeg: symbol lookup error: /home/liam/build/kdenlive/bin/ffmpeg: undefined symbol: av_strlcpy


Any ideas what this problem is? Thank you! :)



jeevesbond
Registered Member
Posts
20
Karma
0

Quote:
maybe it's a bug from (k)ubuntu feisty!?


Might be... The answer is out there somewhere, it's working on my Kubuntu Feisty installation. Am pretty sure it's related to some package that's not installed (although I might be wrong). Maybe some Gnome/GTK malarkey that doesn't get installed? Again, I could be wrong.

Sorry I can't be of more assistance, keep searching: if I managed to fix it, you can too! :)



jeevesbond
Registered Member
Posts
20
Karma
0

I now get this error when trying to use the ffmpeg installed by this script:

/home/liam/build/kdenlive/bin/ffmpeg: error while loading shared libraries: libavformat.so.51: cannot open shared object file: No such file or directory

Have checked and libavformat.so.51 is installed in /home/liam/build/kdenlive/lib/ as it should be, yet ffmpeg doesn't seem to find it? Is anyone else seeing this problem, or is there a way to fix it?



espinosa_cz
Registered Member
Posts
118
Karma
0
OS

Kubuntu issue:

I have just recalled there is a KUbuntu specific issue with some configure scripts, it has to do something with sh versus bash shell!

In Kubuntu sh is called for somewhat reason instead of bash, but some scripts genuinely require more powerful bash shell.

There is a way how to change Kubuntu behavior, force bash usage, check Kubuntu/Ubuntu forums, ffmpeg build is not the only one affected.



AD libavcodec not found

Use LD_DEBUG=libs ./kdenlive.

This is the ultimate way how to check why and when such or another library was picked.

Check relevant post in this forum for details and examples.



AD ffmpeg binary & jeevesbond

Jeevesbond I cannot see any problem in your output sample. FFmpeg binary is CLI tool expecting some command line parameters to operate.

What you intended to do? I have need to call kdenlive I guess.



I use relative paths in my scripts. There is a unfortunate possibility of mishandling them by some distributions.

To test this, use full paths /home/.../kdenlive. The downside is that kdenlive will not be transferable to another directory.



There is a new version of the script fixing some bus and more! Check this post.

viewtopic.php?f=8&t=100

jeevesbond
Registered Member
Posts
20
Karma
0

Quote:
Jeevesbond I cannot see any problem in your output sample. FFmpeg binary is CLI tool expecting some command line parameters to operate.

What you intended to do? I have need to call kdenlive I guess.


That was the error it returned, my input was not included. Anyway, that's irrelevant, the script v2.0 has mysteriously started working. Hurray! The reason for using that version of ffmpeg is that it's a lot newer than the one provided by Ubuntu, mysteriously I can't seem to get an SVN version installed to /usr to work. As this didn't work thought I'd try your script's version instead.

Now Kdenlive refuses to render at all, that's not too much bother though: can just go back to the old 0.4 version when that's required. It's probably not because of your script either. :)



jeevesbond
Registered Member
Posts
20
Karma
0

myself wrote:
Now Kdenlive refuses to render at all


Scratch that, SVN Kdenlive is now working (although it didn't a couple of hours ago for no apparent reason) for me! Seems to be thanks--somehow--to that script. So what are you reading this for? Go and download the version 2 script! :)


espinosa_cz
Registered Member
Posts
118
Karma
0
OS

jeevesbond wrote:


Now Kdenlive refuses to render at all, that's not too much bother though: can just go back to the old 0.4 version when that's required. It's probably not because of your script either. :)


There is (was?) an issue with kdenlive_render binary (part of kdenlive but external executable binary) not being found (or wrong version being found) when kdenlive builded to nonstandard directory, ie other than /usr. I reported it as a bug, check "kdenlive_render binary search path" it possible than with latest SVN it was fixed. The workaround is (was?) to include current directory to PATH variable before launching kdenlive:


export PATH=.:$PATH
kdenlive
jeevesbond
Registered Member
Posts
20
Karma
0

Ah thanks for that, it seems to be fixed now. :)



Think the problem might have been that I wasn't in the directory when firing up kdenlive (using the terminal, from ~/). Does that make sense, or could that not have been the problem?



herrej01
Registered Member
Posts
48
Karma
0

Hi,



this is an answer to leoon, just in case he has still problems with the script:



be sure you have automake1.6 (or 7, ...) and autotools-dev installed (do it from synaptic, for example). I had the same problem working with ubuntu-feisty and pretty sure solved installing these packages. If not let me know and I'll check the rest of packages needed.



Regards.

JM



Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]