domenica 30 novembre 2008

[Basics How-To] How i installed/built ffmpeg with mp3, amr, x264, theora, vorbis, xvid support on Kubuntu Hardy Heron 64-bit

Due to license restrictions the ffmpeg binary/package in K/X/Ubuntu repositories the encoding in restricted formats (such as mp3) is not possible by default. Googling around i found out a lot of different guides for ffmpeg installation, but focusing on one format at a time, or enabling only some of ffmpeg features. Here's a (tested) synthesis of all the guides i found. Credits after the howto.

Be warned that i started from a long-time installation, so some more libraries than stated may need to be installed.

Said this, here we go.

We need to remove the repository package and then to install (or compile) the dependencies needed

First a bit of cleansing

$ sudo apt-get remove ffmpeg

Then some utilities & libraries
$ sudo apt-get install git-core checkinstall build-essential subversion liblame-dev libfaad-dev libfaac-dev libxvidcore4-dev libx264-dev libdts-dev libgsm1-dev libtheora-dev libvorbis-dev libdc1394-13-dev libraw1394-dev

Now we have to create a dir to download the source code for ffmpeg and related dependencies
$ mkdir src

Move inside the newly created dir
$ cd src

Now we have to get all of the needed code through subversion, git and wget
$ svn checkout svn:// ffmpeg
$ git clone git://
$ wget
$ wget
$ wget

Untar the tarballs
$ tar -xjvf amrnb-
$ tar -xjvf amrwb-
$ tar -xzvf yasm-0.7.2.tar.gz

Now some compile&install using checkinstall.
Checkinstall is an application meant to replace the 'make install' final command in the process of software installation, by building and installing a .deb (or .rpm or .tgz) package, thus allowing the tracking of the change made, easing software removal.
The output of the process will be a bunch of installed binary packages, removable through dpkg ($sudo dpkg -r [package_name])

Yasm is a modular assembler that will optimize x264 code for MMX/SSE, thus improving encoding speed. The package in Hardy repository is not-so-up-to-date so let's build it.
$ cd yasm-0.7.2
$ ./configure
$ make
$ sudo checkinstall
$ cd ..

Libamr is the audio encoder/decoder for 3gp format (don't know why, checkinstall isn't successful with these)
$ cd amrnb-
$ ./configure --prefix=/usr
$ make
$ sudo make install
$ cd ..

$ cd amrwb-
$ ./configure --prefix=/usr
$ make
$ sudo make install
$ cd ..

From Wikipedia: x264 is a free software library for encoding H.264/MPEG-4 AVC video streams
$ cd x264
$ ./configure --prefix=/usr --enable-shared
$ make
$ sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1"
$ sudo ldconfig
$ cd ..

At last, here we go with ffmpeg km-long configuration line, then the usual make && checkinstall
$ cd ffmpeg
$ ./configure --enable-gpl --enable-swscale --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libvorbis --enable-libgsm --enable-libdc1394 --disable-debug --enable-shared --enable-libmp3lame --enable-libfaad --enable-libfaac --disable-vhook --enable-libxvid --enable-libx264 --enable-postproc --enable-libamr-nb --enable-libamr-wb --enable-avfilter --enable-nonfree --prefix=/usr
$ make
$ sudo checkinstall

And that's it!

Credits to:
FFMpeg Documentation & for software usage help

Don't forget myself...... ^^

venerdì 21 novembre 2008

OdfConverter [with libtiff4] on Kubuntu Gutsy - Howto

Steps to install odf-converter (software that converts MS OpenXML formats in ODF)

1. Download odf-converter-1.1-7.i586.rpm (for x86_32) or odf-converter-1.1-7.x86_64.rpm (for x86_64)
2. Install alien and rpm --> In a terminal just type $sudo apt-get install rpm alien
3. Move to the folder in which the rpm has been downloaded. Convert the .rpm package to a .deb package --> In a terminal $cd /folder/in/which/is/rpm/ - then - $sudo alien -dv odf-converter-1.1-7.x86_64.rpm (or odf-converter-1.1-7.i586.rpm if on 32-bit hardware)
4. Install the newly built .deb package --> $sudo dpkg -i odf-converter_1.1-8_amd64.deb
5. Copy the binary to the binaries folder --> $sudo cp /usr/lib/ooo-2.0/program/OdfConverter /usr/bin
6. Try running Odfconverter --> $OdfConverter
6.b [to do only if the previous command returned "OdfConverter: error while loading shared libraries: cannot open shared object file: No such file or directory"] Create a symlink named pointing to and update libraries cache --> $sudo ln -s /usr/lib/ /usr/lib/ && sudo ldconfig
7. Start using software --> OdfConverter /I

Credits: for the libtiff trick