Cinelerra with external ffmpeg

Posted by Ralph on March 7, 2009 - 4:25 pm

This post is the continuation to my previous post here. Today we will compile Cinelerra to use external ffmpeg support. If you haven’t read previous post I strongly recommend you to do so now. This post picks up where I have left there.

1. Prerequisites

To compile Cinelerra we need to install:

$ sudo apt-get install automake1.9 autoconf g++ x11proto-xf86vidmode-dev libxxf86vm-dev

installing dependencies:

$ sudo apt-get install libasound2-dev libiec61883-dev libsndfile1-dev liba52-0.7.4-dev libfftw3-dev uuid-dev libdv4-dev libopenexr-dev libmjpegtools-dev

2. Getting Cinelerra sources

$ cd ~/video
$ git clone git://git.cinelerra.org/j6t/cinelerra.git cinelerra
$ cd cinelerra

3. Compiling

Before we can start compiling we have to make few modifications to the system files. Without modifications Cinelerra configuration and compilation scripts want be able to find
needed libraries. I bet there is other way to make it work but I have found this way to be the only way to do that with the newest Cinelerra and ffmpeg code. If you happen to know the proper
way to do that using FFMPEG_TEMP_CFLAGS, FFMPEG_TEMP_LIBS, FFMPEG_CFLAGS, FFMPEG_LIBS or any other flags please post a comment.

$ cd /usr/local/lib/pkgconfig

Copy following files to save place:

$ cp libavcodec.pc  libavdevice.pc  libavfilter.pc  libavformat.pc  libavutil.pc  libpostproc.pc  libswscale.pc ~/video

Now we have to edit those files. In each of this files edit the line starting with includedir=${prefix}/include and add the library name after backslash. For libavcodec.pl file your line should look like
includedir=${prefix}/include/libavcodec for libswscale.pc: includedir=${prefix}/include/libswscale. We are of course editing files in /usr/local/lib/pkgconfig.

now we are ready to configure and compile Cinelerra

$ ./autogen.sh
$ ./configure --prefix=/usr/local --enable-opengl --with-external-ffmpeg
$ make
$ sudo make install
$ sudo ldconfig

4. Clean up

Copy saved pkgconfig files back where they ware:

$ cd ~/video
$ sudo cp lib*.pc /usr/local/lib/pkgconfig/

Thats all! You can now test your new Cinelerra.

Installing Kohana PHP Framework

Posted by Ralph on March 1, 2009 - 4:27 am

This time I will show you how to install Kohana PHP framework. You can find it here.

Kohana is lightweight PHP MVC (Model-View-Controller) framework written strictly in PHP 5.0.

This is my first tutorial in HD! To watch it in HD you have to click an HD icon and go to vimeo.com. Unfortunately Vimeo does not allow to embed HD videos yet. Of course it’s best to watch it in full screen with scaling off. Have fun!

Of course any comments or suggestions greatly appreciated.


Untitled from ralphz on Vimeo.

Compiling custom ffmpeg with all bells and whistles on Ubuntu 8.10

Posted by Ralph on March 1, 2009 - 4:14 am

This is first of two blog posts explaining how to compile and install ffmpeg with all supporting libraries. This tutorial is based on one of the tutorials I have found online. It would be way harder to write it without it. You can find it here: http://juliensimon.blogspot.com/2008/12/howto-compiling-ffmpeg-x264-mp3-xvid.html.

I’m assuming that you are using Ubuntu 8.10 Intrepid Ibex with all the ffmpeg libraries, gstreamer libraries, ubuntu-restricted-extras and ffmpeg already installed. I have tested the steps on fresh Ubuntu install so there should be no problem following them. You should probably install ubuntu-restricted-extras package before proceeding with the tutorial.

Prerequisites

Before we start we have to install subversion and git repository tools.


$ sudo apt-get install subversion git git-core

We also have to remove Ubuntu version of ffmpeg so there are no conflicts with the new one we will be installing.


$ sudo apt-get remove ffmpeg

All software sources will go to the ~/video folder. So lets create it:

$ mkdir ~/video

Now we have to install some additional libraries that are required by ffmpeg during compilation.

2. Installing libamr

This library is needed for 3GPP speech codecs. You can read more about it here: http://en.wikipedia.org/wiki/Adaptive_multi-rate_compression
Unfortunately libamr is not in Ubuntu repository so we have to pool it from Madiabuntu repositories. To do that we have to add Mediabuntu repositories to our sources list:


$ sudo wget http://www.medibuntu.org/sources.list.d/hardy.list --output-document=/etc/apt/sources.list.d/medibuntu.list
$ sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

Now we can just apt-get it with the command:


$ sudo apt-get install libamrnb-dev libamrwb-dev

3. Installing libnut

NUT is a container format under construction by MPlayer and ffmpeg developers. Libnut needs to be built from source:


$ cd ~/video
$ svn co svn://svn.mplayerhq.hu/nut/src/trunk/ nut
$ cd nut
$ make
$ sudo make install
$ sudo ldconfig

4. Installing libx264


$ cd ~/video
$ sudo apt-get install libgpac-dev yasm
$ git clone git://git.videolan.org/x264.git
$ cd x264
$ ./configure --prefix=/usr/local --enable-shared --enable-pic
$ make
$ make install
$ sudo ldconfig

5. Installing libxvid


$ cd ~/video
$ sudo apt-get install nasm
$ wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
$ tar xvfz xvidcore-1.2.1.tar.gz
$ cd xvidcore/build/generic
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ sudo ldconfig

6. Installing additional libraries


$ sudo apt-get install libfaac-dev libfaad-dev libschroedinger-dev libtheora-dev libvorbis-dev libxv-dev libxvmc-dev libmp3lame-dev libgsm1-dev libavc1394-dev libdc1394-22-dev libimlib2-dev libdirac-dev libbz2-dev libspeex-dev libopenjpeg-dev libsdl-gfx1.2-dev

7. Configure and build ffmpeg


$ cd ~/video
$ svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
$ cd ffmpeg

Now if you have Nvidia video card you may want to install the latest drivers to take advantage of hardware encoding and decoding in ffmpeg. You can read more about this technology here: http://en.wikipedia.org/wiki/VDPAU. To do that install following packages from Ubuntu repository:


$ sudo apt-get install nvidia-180-kernel-source nvidia-glx-180 nvidia-glx-180-dev

and restart your computer when drivers are installed. After restart (assuming everything works) you are ready to configure the ffmpeg:


$ ./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-shared --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-x11grab --enable-bzlib --enable-libamr-nb --enable-libamr-wb --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --enable-libspeex --enable-libopenjpeg --enable-libdirac --enable-vdpau --enable-x11grab

If you use other video card or your Nvidia chipset is not supported (http://www.mythtv.org/wiki/VDPAU) by the new driver use this configuration option:


$ ./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-shared --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-x11grab --enable-bzlib --enable-libamr-nb --enable-libamr-wb --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --enable-libspeex --enable-libopenjpeg --enable-libdirac --enable-x11grab
$ make
$ sudo make install

I know below command should not be used (read more here: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html section 3.3.1.) but without it our new ffmpeg will not work. I have tried to solve this problem with switches –extra-ldflags=”-R/usr/local/lib” and –extra-cflags=”-Wl,-rpath,/usr/local/lib” but it did not work. Either I don’t understand the problem or there is something wrong with ffmpeg Makefiles. If someone has an idea how to solve it please post a comment.


$ echo "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
$ source ~/.bashrc
$ sudo ldconfig

Now lets test our new ffmpeg:


$ ffmpeg -version
FFmpeg version SVN-r17621, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-shared --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-x11grab --enable-bzlib --enable-libamr-nb --enable-libamr-wb --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --enable-libspeex --enable-libopenjpeg --enable-libdirac --enable-vdpau
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.19. 0 / 52.19. 0
libavformat 52.30. 0 / 52.30. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Feb 26 2009 15:39:39, gcc: 4.3.2
FFmpeg SVN-r17621
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.19. 0 / 52.19. 0
libavformat 52.30. 0 / 52.30. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0

Seems like everything is OK. Have fun!

Next Page »