I had a lot of problems to compile codes that uses ffmpeg...After a
lot of attempts and search on the internet I created a script to do
the job, installing from the source (git repository). I don't know if
it is the best way (there are a lot of options to configure ffmpeg, I
just enabled the building of both static and dinamic libraries and
support for libx264). The script installs libx264, if you don't want
it just remove the lines of its installation.

#!/bin/bash
#script to install/update x264 and ffmpeg
#must run as root

#installing dependencies
apt-get install git-core yasm

cd /usr/local/src

#uninstalling previous installation
installed=0
if [ -d "x264" ]; then
        echo "uninstalling x264"        
        cd x264
        make uninstall
        make distclean
        cd ..
        rm -R x264
        installed=1
fi

if [ -d "ffmpeg" ]; then
        echo "uninstalling ffmpeg"
        cd ffmpeg
        make uninstall  
        make distclean
        cd ..
        rm -R ffmpeg
        installed=1
fi

if [ $installed -eq 1 ]; then
        echo "x264 and ffmpeg uninstalled"
else
        echo "x264 and ffmpeg were not installed"
fi

#installing x264
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-static --enable-shared
make
make install
cd ..

#installing ffmpeg
git clone git://git.videolan.org/ffmpeg
cd ffmpeg
./configure --enable-shared --enable-gpl --enable-version3
--enable-nonfree --enable-libx264
make
make install
cd ..

ldconfig
echo "Installation Completed"

I hope it helps you.

2011/6/14 JunHorng <[email protected]>:
> Thank you for your reply. I have done what you said, but the error message:
> undefined reference to `avcodec_decode_video2'
> is still shown. Besides, a warning message:
> ‘dump_format’ is deprecated
>
> is also shown. Would you please advice me how you compile FFmpeg in    the
> Ubuntu system?
> Best regards,
> Jun-Horng Chen
>
>
> 2011/6/13 Gustav González <[email protected]>
>>
>> Did you try?:
>>
>> % sudo apt-get install libavcodec-dev libavcodec52
>> % sudo apt-get install libavformat-dev libavformat52
>> % sudo apt-get install libavutil-dev libavutil50
>>
>> 2011/6/12 JunHorng <[email protected]>:
>> > Hello,
>> > Following the
>> >
>> > instruction: http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289 ,
>> > I have installed the   FFmpeg libraries in my Ubuntu system. At the
>> > beginning, it seems to be fine. When I tested the libraries with the
>> > example
>> > program : "libavcodec/api-example.c", an error message :
>> > undefined reference to `avcodec_decode_video2'
>> > will be shown in the project building process.
>> > Does that mean what I installed is an old version of FFmpeg?
>> > I am appreciated for any help.
>> > JunHorng
>> > _______________________________________________
>> > Libav-user mailing list
>> > [email protected]
>> > http://ffmpeg.org/mailman/listinfo/libav-user
>> >
>> >
>>
>>
>>
>> --
>> ============================
>>   Gustav Gonzalez
>>   [email protected]
>> ============================
>> _______________________________________________
>> Libav-user mailing list
>> [email protected]
>> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
> _______________________________________________
> Libav-user mailing list
> [email protected]
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to