Friday, October 3, 2014

Setting up ffmpeg 2.4.0 for eclipse in ubuntu 12.04

First of all make sure your OS has no previous installation content of ffmpeg installed in ubuntu.
In case you have a previous installation of ffmpeg, then delete those folders and type
sudo apt-get remove ffmpeg x264
sudo apt-get autoremove
in terminal to remove any previous ffmpeg installation content.
Then start from here
sudo apt-get update
sudo apt-get upgrade

sudo apt-get install make automake g++ bzip2 python unzip patch subversion ruby build-essential git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvdpau-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
in case it gives error of ERROR: libopencore_amrnb not found
type
sudo apt-get install libopencore-amrnb
then install x264
sudo wget http://webm.googlecode.com/files/libvpx-v0.9.7-p1.tar.bz2
sudo tar xvjf libvpx-v0.9.7-p1.tar.bz2
cd libvpx-v0.9.7-p1
sudo ./configure –enable-shared –prefix=/usr/local
sudo make
sudo make install
cd ..

in case you get an error “Found yasm 1.1.0.2352
Minimum version is yasm-1.2.0
If you really want to compile without asm, configure with –disable-asm.”
it means your yasm version is too low, so you should install a latest version of yasm
git clone git://github.com/yasm/yasm.git
cd yasm
./autogen.sh
./configure
make
make install

and then continue with installing x264
install libvpx
sudo wget http://webm.googlecode.com/files/libvpx-v0.9.7-p1.tar.bz2
sudo tar xvjf libvpx-v0.9.7-p1.tar.bz2
cd libvpx-v0.9.7-p1
sudo ./configure –enable-shared –prefix=/usr/local
sudo make
sudo make install
cd ..

After this check if /etc/ld.so.conf contains the lines /usr/lib and /usr/local/lib. if not then add them and save it
to check that do
sudo gedit /etc/ld.so.conf
or
sudo nano /etc/ld.so.conf

then run
sudo ldconfig
Now you can install ffmpeg by doing

sudo wget http://ffmpeg.org/releases/ffmpeg-0.8.10.tar.bz2
sudo tar xvjf ffmpeg-0.8.10.tar.bz2
cd ffmpeg-0.8.10
./configure –enable-gpl –enable-version3 –enable-nonfree –enable-postproc –enable-libfaac –enable-libmp3lame –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libtheora –enable-libvorbis –enable-libvpx –enable-libx264 –enable-libxvid –enable-shared –prefix=/usr/local
sudo make
sudo make install
cd ..
sudo ldconfig

In your eclipse project you can inculde the headers this way
#include #include
In eclipse you can add the ffmpeg libraries to your project: avutil, avformat, avcodec, m, z … by going to project->properties->C/C++->Build->Settings->GCC C++-> Linker->Libraries

No comments:

Post a Comment