Installing FFMPEG on Linux

FFMPEG is an open source application that allows you to convert video and audio files easily between a variety of different formats. It supports most industry-standard codec and can convert from one file format to another quickly and easily. This article will guide you to installing FFMPEG and other codec on Linux.

FFMPEG Installation Requirements:

  • FFMPEG
  • LAME Mp3 Audio Codec (Requred for mpg, flv, avi, wmv etc files)
  • AMR Audio Codec (Required for 3gp video files)
  • XVID Audio Codec
  • FFMPEG-PHP

Note on installing FFMPEG:

  • All the Audio Codec getting used in FFMPEG are not part of FFMPEG Source base

Converting Audios Videos Using FFMPEG

FFMPEG Download URL:
On the download page of FFMPEG they have geven the download link from SVN and checkout-snapshot but i would suggest to use SVN source code base.
FFMPEG Download Page FFMPEG
The url for the SVN source code for FFMPEG is: svn://svn.mplayerhq.hu/ffmpeg/trunk

To download from SVN you will have to install subversion located at subversion.tigris.org, or you can use “TortoiseSVN” located at tortoisesvn.tigris.org.

LAME Mp3 Codec download URL: Lame Mp3 Codec

Executing FFMPEG Command from PHP Applications

AMR Audio Download URL: AMR Audio Codec
To install the AMR codec you will require both AMR-WB and AMR-NB files.

XVID Audio Download URL: XVID Audio Codec

FFMPEG-PHP Download URL: FFMPEG-PHP

Installation Steps:
It is a good practice to install all the external audio codec libraries first and then install the FFMPEG.

Installing LAME MP3 Encoder

  • Untar the lame file by using tar zxvf lametarfile
  • Assign 777 permission rights to the lame folder by typing chmod 777 lamefolder -R
  • Traverse to the root of lame folder and type
    ./configure
    make
    make install

Extract Video Thumbnail from FFMPEG

Installing AMR Codec
For installing the AMR codec there are two separate files that needs to be installed are AMR-WB and AMR-NB.

  • Untar the AMR file by using tar zxvf tarfile
  • Assign 777 permission rights to the amr folder by typing chmod 777 amrfolder -R
  • Traverse to the root of amr folder and type
    ./configure
    make
    make install

Note on Installing AMR:
You might get errors installing AMR codec on Autoconf utility of linux. To resolve this problem will have to install the latest version of Autoconf utility from Download AutoConf

Installing Xvid Codec

  • Untar the xvid file bu using tar zxvf tarfilename
  • Assign 777 permission rights to the lame folder by typing chmod 777 xvidfolder -R
  • Traverse to the root of xvid folder
  • Goto Build/generic folder and type
    ./configure
    make
    make install

Installing GCC

  • This is required only if the SVN for FFMPEG is not compatible with the existing version of GCC(3x) requires a new version for the same
  • After the installation of GCC need to convert all the files of SVN to Unix compatible by using “dos2unix ffmpegfolder/* -R”.

Installing FFMPEG

  • Download the ffmpeg from SVN
  • Assign 777 permission rights to the ffmpeg folder by typing chmod 777 ffmepgfolder -R
  • Traverse to the root of ffmpeg folder and type
    ./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared
    make
    make install


Installing FFMPEG-PHP

  • Download the ffmpeg-php from Sourceforge
  • Unpack the archive by using following command “tar -xjf ffmpeg-php.X.XX.tar.gz”
  • Iterate inside the ffmpeg-php directory
  • Run phpize (included with your php install) to build configuration files
    ./configure
    make
    make install

NOTE FOR FFMPEG-PHP:
If you are planning to install FFMPEG-PHP then will have to add –enable-shared parameter while configuring FFMPEG

You might get installation error while making the file related to html or texti files in ffmpegdoc folder. The solution for this that worked for me is to just create a empty file by using touch command in the respective folders.

Note:
The following configure parameter will work with FFMPEG 0.49. But now the latest version does not have –enable-libogg parameter so if you are planning to installing the latest version then the configure parameter would be /configure –enable-libmp3lame –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared.

Note on Reinstalling FFMPEG:
If you are planning to reinstall the FFMPEG software the will have to perform following steps:

  • ./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared
  • make clean
  • make
  • make install

Lot of people are facing error on loading shared libraries libavdevice.so.52, solution to the same is:
export LD_LIBRARY_PATH=/usr/local/lib/

Still facing problem while installing leave a comment, will try my best to help you out. :)

Tagged . Bookmark the permalink.

84 Responses to Installing FFMPEG on Linux

  1. Edward says:

    Hi

    Could you please explain and give me good suggestions on ffmpeg on windows based operating systems?

    Thank you.

    Regards.

  2. admin says:

    Hi Edward,
    I have not tried installing FFMPEG on windows but i will try installing FFMPEG on Windows OS and will update the POST ASAP.

  3. Amr Diab says:

    Hello webmaster…Thanks for the nice read, keep up the interesting posts..what a nice Friday

  4. Daniel says:

    I couldn’t understand some parts of this article ing FFMPEG on Linux | Techie Zone, but I guess I just need to check some more resources regarding this, because it sounds interesting.

  5. admin says:

    Hi Daniel,
    Tell me if you have not understood any part. I may help you out in Installing FFMPEG.

  6. Pingback: Converting Audio/Videos using FFMPEG | Techie Zone

  7. Nahian says:

    hi
    i want to use ffmpeg to convert .flv to .amr
    i installed both libamr-nb and libamr-wb
    and installed ffmpeg with
    “./configure –enable-libamr-nb –enable-libamr-wb”

    but then ffmpeg command gives me following error..

    “ffmpeg: error while loading shared libraries: libamrnb.so.3: cannot open shared object file: No such file or directory”

    what’s going on.?
    please help.

    nahian

  8. Hi Nahian,
    Based on the configure parameter you have send , I think you have not install the FFMPEG correctly. Also can u give me the steps you have followed while installing FFMPEG.

  9. Nahian says:

    hi hitesh.
    thanx for helping..

    i used following commands for installing libamr-nb and libamr-wb

    ./configure
    make clean
    make
    make install

    and for installing ffmpeg

    ./configure –enable-libamr-wb –enable-libamr-nb –enable-shared
    make clean
    make
    make install

    now for ffmpeg command i find this message

    “ffmpeg: error while loading shared libraries: libavformat.so.51: cannot open shared object file: No such file or directory”

    again i tried with this.
    ./configure –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-gpl –enable-shared
    but same thing happened

    but using “locate libavformat.so.51″ command i find following ..
    /usr/local/lib/libavformat.so.51.17.0
    /usr/local/lib/libavformat.so.51

    i’m using (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)

  10. Hi Nahian,
    Seeing your configure parameter for FFMPEG, you will also have to install LAME Mp3 Codec as FLV uses mp3 for its audio. I have already mentioned about Lame Mp3 codec in this post.

    Also first install the Lame Mp3 and then install ffmpeg again using
    ./configure –enable-libmp3lame –enable-libamr-wb –enable-libamr-nb –enable-shared
    make clean
    make
    make install

  11. Nahian says:

    hi i got it.
    i /usr/local/lib wasnt in ld.so.conf file..

    thanx for helping

  12. Munish Dogra says:

    Hi Hitesh,

    Thanks for publishing useful article.

    However after installing ffmpeg and run at the terminal window in Linux I have got the error as follows
    ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

    Best Regards’
    Munish Dogra

  13. Hi Munish,
    Is this error coming when you are writing typing ‘ffmpeg’ command or when trying to convert media.

    Hitesh Agarwal

  14. Munish Dogra says:

    Thanks for the Reply.

    When typing ffmpeg command.

    Regards’
    Munish Dogra

  15. Hi Munish Dogra,
    I think you have not installed FFMPEG Correctly. Reinstall the FFMPEG using steps mentioned in this post.

    Also the codecs in the configure will be as per the codecs installed for ffmpeg.

    Regards,
    Hitesh A

  16. skidrab says:

    I’m trying to install on a unix system/apache webserver. Can you point me to the steps I need to take for this.

  17. Monti says:

    Hi I m facing problem to install .so file, I want to install ffmpeg but I can’t install .so file, Anyboby could help me

    Monti

  18. Lee says:

    I’ve been trying to get the extension ogghandler to work on an installation of mediawiki. It requires ffmpeg and I thought that I installed it correctly but I keep getting the error:

    Error creating thumbnail: /home/usr/bin/ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

    that file is located there and but I can’t seem to get around this one. Any ideas?

  19. Hi skidrab,
    Sorry for replying late, but as far your query on installing FFMPEG you can refer to this article. But make sure you install it in sequence mentioned in the article.

    Does this answer your comment?

    Hitesh

  20. Hi Monti,
    Can u please describe your installation problem briefly.

    Hitesh

  21. Pingback: Jack

  22. Rajeev Srinivasan says:

    Hi,

    Has anyone tried installing FFMpeg on windows and integrate it with visual studio.

    I trying to run both the encoder and decoder which is in the output_eaxmaple.c file.

    It will be great if someone has already done this.

  23. Jurik says:

    Hello,

    all steps work until I reach ffmpeg-php installation.
    I use openSUSE 10.3 and newest ffmpeg version and ffmpeg-php 0.5.0

    After configure and make I do make test and there comes all those errors:
    “PHP Warning: PHP Startup: Unable to load dynamic library ‘modules/ctype.so’ – modules/ctype.so: cannot open shared object file: No such file or directory in Unknown on line 0″

    And this error for each build-in mod. And all

    Number of tests : 31 19
    Tests skipped : 12 ( 38.7%) ——–
    Tests warned : 0 ( 0.0%) ( 0.0%)
    Tests failed : 19 ( 61.3%) (100.0%)
    Tests passed : 0 ( 0.0%) ( 0.0%)

    So I guess there is a problem with my php-configuration, right?

  24. monika says:

    Hello ,
    I want to convert any audio or video file into flv. T have ffmpeg.exe which is running on windows. I want to run on linux so what i do? Is there any other file like windows from there i can convert .flv file? Please suggest

  25. agtest says:

    Hi,
    I followed the given steps in this article. But I get the following error ./home/dev3/public_html/vasanthi/ffmpeg/libavcodec/libavcodec.so: undefined reference to GP3Decoder_Interface_Decode'
    /home/dev3/public_html/vasanthi/ffmpeg/libavcodec/libavcodec.so: undefined reference to
    VADxEncoder_Interface_init’
    /home/dev3/public_html/vasanthi/ffmpeg/libavcodec/libavcodec.so: undefined reference to `GP3VADxEncoder_Interface_Encode’
    collect2: ld returned 1 exit status
    make: *** [ffmpeg_g] Error 1
    How to solve this . Help pls
    Thanks

  26. Hi agtest,

    I have tested this installation steps on RHEL, Fedora Core 6. On which Operating System you are installing this as i didn’t came up with such errors during installation.

    Hitesh A

  27. Hi Monika,

    For installing FFMPEG on linux please follow the installation steps as stated in this article. Also you can try Sohenson Squeeze (windows) which is a commercial product for .flv conversion.

    Hitesh A

  28. Fran García says:

    For those who got an error like “error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory”, you can do the next:

    cd /etc/ld.so.conf.d

    add another file: custom-libs.conf

    inside, put :

    /usr/local/lib

    save,

    then do ldconfig

    Seen at http://www.512kbps.com/2008/01/28/error-while-loading-shared-libraries-libavdeviceso52-cannot-open-shared-object-file-no-such-file-or-directory/

  29. Fran García says:

    I’m getting an error trying to convert a video with the mp4a audio codec. Has anybody got a solution? This is the error:

    …..

    Stream #0.1(eng): Audio: mp4a / 0x6134706D, 44100 Hz, stereo

    …..

    Unsupported codec (id=86018) for input stream #0.1

  30. Fran García says:

    Well, I’ve solved the problem. I had to install the faad library, but it has some other dependencies like libid3-dev, which we must install before installing the faad library.

  31. pravin k says:

    hi,
    Nice information really worth…

    thanks
    pravin

  32. eldo says:

    while using the ffmpeg command I get the following errors

    ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

  33. Hi eldo,
    Try reinstalling the FFMPEG again having –enable-gpl –enable-shared parameter.

  34. Frank says:

    I used this command
    ./configure –prefix=$HOME –enable-libamr-wb
    But got this error:
    libamr is nonfree and –enable-nonfree is not specified.

    So I used this one:
    ./configure –prefix=$HOME –enable-libamr-wb –enable-nonfree
    and got this error:
    ERROR: libamrwb not found

    I have already installed the AMR, and it located at /home/username/lib, I think error happened because it can not find the lib directory under my user root. Are there any way to tell ./configure the place for the AMR library?

    Thanks very much.

  35. Frank says:

    Note to above comment, I am using web hosting and no way to update /etc/ld.so.conf.d, so anyone ever used ffmpeg in web hosting server?

  36. Neveo says:

    Hi I have a question about installation. I installed all the files in usr/local when i tried the last part from the ffmpeg dir.. i get this error

    Unknown option “–enable-libmp3lame”.
    See ./configure –help for available options.

    then i tried just ./configure -enable-shared

    i get this

    bash: ./configure: No such file or directory

    keep in mind i am running the commands from the ffmpeg dir.

    so from teh ffmpeg dir i just ran the ./configure
    make
    make install

    i got so many warnings and deprecated warning. in the end i got
    install -d “/usr/local/bin”
    install -c -m 755 ffmpeg ffserver “/usr/local/bin”

    so my dir structure looks like this

    usr/local
    usr/local/ffmpeg
    usr/local/lame-3.97
    usr/local/amrnb-7.0.0.0
    usr/local/amrwb-7.0.0.2

    all the file that i untared are on the same level should they have all been under the ffmpeg. how would i run a test scrip to convert any video format to .flv?

    Thanks any help would be much appreciated.

    Neveo

  37. Frank says:

    Follow this instruction, you can install succesfully
    http://www.netbrix.net/archives/20
    Good luck

  38. Mayank says:

    Hi Hitesh,

    I have tried installing ffmpeg on Linux.
    1.downloaded svn checkout version
    2.unzipping it using tar -xjf command
    3.Do ./configure –enable-shared
    4.Make install
    5.make

    I got the .so libraries in /usr/lib/local folder
    but when i am linking the above librraies and running the code i am getting the segmentation fault error in av_open_input_stream.

    I think that there is error in ffmpeg installation.

    Please guide me how should i be able to install the ffmpeg correctly.

    Regards,
    Mayank

  39. saf says:

    HI
    all the above were installed easily
    Thanx for this wounderful guide but I have some problems in installing FFMPEG-PHP I got that install after that no further commaands runs like ./configure

    Kindly guide me

    Thanx and regards,

    SAF

  40. tarique says:

    Hi,
    Hitesh

    Please help me. I want to convert 3gp file into flv using ffmpeg. The syntax is

    ffmpeg -i upload/video/song/test.3gp -y -ab 56 -ar 22050 -ac 2 -qscale 9 -t 900 -r 15 -s 320*240 upload/video/song/test.flv

    this convert the 3gp file into flv but flv size is 0kb.
    So please guide me and send the correct command to convert the 3gp into flv

    Thanks in advance

  41. Alucato says:

    When i try to execute the comand make for ffmpeg-php i get this:

    checking for egrep… grep -E
    checking for a sed that does not truncate output… /bin/sed
    checking for gcc… gcc
    checking for C compiler default output file name… a.out
    checking whether the C compiler works… yes
    checking whether we are cross compiling… no
    checking for suffix of executables…
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ANSI C… none needed
    checking whether gcc and cc understand -c and -o together… yes
    checking if compiler supports -R… no
    checking if compiler supports -Wl,-rpath,… yes
    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking target system type… i686-pc-linux-gnu
    checking for PHP prefix… /usr/local
    checking for PHP includes… -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
    checking for PHP extension directory… /usr/local/lib/php/extensions/no-debug-non-zts-20060613
    checking for PHP installed headers prefix… /usr/local/include/php
    checking for re2c… re2c
    checking for re2c version… 0.13.3 (ok)
    checking for gawk… gawk
    checking for ffmpeg support… yes, shared
    checking for ffmpeg headers… …found in /usr/local/include/ffmpeg
    checking for ffmpeg libavcodec.so… …found in /usr/local/lib
    checking for ld used by gcc… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking for /usr/bin/ld option to reload object files… -r
    checking for BSD-compatible nm… /usr/bin/nm -B
    checking whether ln -s works… yes
    checking how to recognise dependent libraries… pass_all
    checking how to run the C preprocessor… gcc -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking dlfcn.h usability… yes
    checking dlfcn.h presence… yes
    checking for dlfcn.h… yes
    checking for g++… g++
    checking whether we are using the GNU C++ compiler… yes
    checking whether g++ accepts -g… yes
    checking how to run the C++ preprocessor… g++ -E
    checking the maximum length of command line arguments… 32768
    checking command to parse /usr/bin/nm -B output from gcc object… ok
    checking for objdir… .libs
    checking for ar… ar
    checking for ranlib… ranlib
    checking for strip… strip
    checking if gcc static flag works… yes
    checking if gcc supports -fno-rtti -fno-exceptions… no
    checking for gcc option to produce PIC… -fPIC
    checking if gcc PIC flag -fPIC works… yes
    checking if gcc supports -c -o file.o… yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries… yes
    checking whether -lc should be explicitly linked in… no
    checking dynamic linker characteristics… GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking whether stripping libraries is possible… yes
    checking if libtool supports shared libraries… yes
    checking whether to build shared libraries… yes
    checking whether to build static libraries… no

    creating libtool
    appending configuration tag “CXX” to libtool
    checking for ld used by g++… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking for g++ option to produce PIC… -fPIC
    checking if g++ PIC flag -fPIC works… yes
    checking if g++ supports -c -o file.o… yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking dynamic linker characteristics… GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking whether stripping libraries is possible… yes
    configure: creating ./config.status
    config.status: creating config.h
    config.status: config.h is unchanged
    root@angie [/usr/local/src/ffmpeg-php-0.5.0]# make
    /bin/sh /usr/local/src/ffmpeg-php-0.5.0/libtool –mode=compile gcc -I. -I/usr/local/src/ffmpeg-php-0.5.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.5.0/include -I/usr/local/src/ffmpeg-php-0.5.0/main -I/usr/local/src/ffmpeg-php-0.5.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/ffmpeg -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c -o ffmpeg_frame.lo
    gcc -I. -I/usr/local/src/ffmpeg-php-0.5.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.5.0/include -I/usr/local/src/ffmpeg-php-0.5.0/main -I/usr/local/src/ffmpeg-php-0.5.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/ffmpeg -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c -fPIC -DPIC -o .libs/ffmpeg_frame.o
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c: In function _php_convert_frame':
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:162: warning: implicit declaration of function
    img_convert’
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c: In function _php_crop_frame':
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:215: warning: implicit declaration of function
    img_copy’
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c: In function _php_resample_frame':
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error:
    ImgReSampleContext’ undeclared (first use in this function)
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error: (Each undeclared identifier is reported only once
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error: for each function it appears in.)
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error: img_resample_ctx' undeclared (first use in this function)
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:263: warning: implicit declaration of function
    img_resample_full_init’
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:276: warning: implicit declaration of function img_resample'
    /usr/local/src/ffmpeg-php-0.5.0/ffmpeg_frame.c:281: warning: implicit declaration of function
    img_resample_close’
    make: *** [ffmpeg_frame.lo] Error 1

    Cant continue, please help

  42. Simeon says:

    Got the same errors like Alucato.
    make: *** [ffmpeg_frame.lo] Error 1
    How can we fix that?

  43. Dibyendu says:

    Hi I am getting the following error:

    ./configure –enable-libmp3lame –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared –enable-nonfree
    Unable to create and execute files in /tmp. Set the TMPDIR environment
    variable to another directory and make sure that /tmp is not mounted
    noexec.
    Sanity test failed.
    If you think configure made a mistake, make sure you are using the latest
    version from SVN. If the latest version fails, report the problem to the
    ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
    Include the log file “config.err” produced by configure as this will help
    solving the problem.

    Please help me

  44. R says:

    Hi,

    Can anyone elaborate to me the steps for compiling ffmpeg on linux with support for watermarks? i.e. how to compile ffmpeg to add the watermark module and how to configure vhooks?

    Thanks in advance.

  45. Bob says:

    Same error as a few posts above:

    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c: In function _php_convert_frame':
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:162: warning: implicit declaration of function
    img_convert’
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c: In function _php_crop_frame':
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:215: warning: implicit declaration of function
    img_copy’
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c: In function _php_resample_frame':
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error:
    ImgReSampleContext’ undeclared (first use in this function)
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error: (Each undeclared identifier is reported only once
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error: for each function it appears in.)
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:237: error: img_resample_ctx' undeclared (first use in this function)
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:263: warning: implicit declaration of function
    img_resample_full_init’
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:276: warning: implicit declaration of function img_resample'
    /root/ffmpeg/ffmpeg-php-0.5.0/ffmpeg_frame.c:281: warning: implicit declaration of function
    img_resample_close’
    make: *** [ffmpeg_frame.lo] Error 1

    Any ideas?

    • Hi Bob,
      I was also trying to install FFMPEG-PHP but it was not getting installed due to the same error. After 2 days of fight i manage to install FFMPEG-PHP on my Laptop.

      Before Installing FFMPEG and FFMPEG-PHP i installed following items using yum.

      yum install gcc gcc-c++ libgcc gd gd-devel gettext freetype freetype-devel ImageMagick ImageMagick-devel libjpeg* libjpeg-devel* libpng* libpng-devel* libstdc++* libstdc++-devel* libtiff* libtiff-devel* libtool* libungif* libungif-deve* libxml* libxml2* libxml2-devel* zlib* zlib-devel* automake* autoconf* samba-common* ncurses-devel ncurses patch

      After installing the above packages, i reinstalled FFMPEG and FFMPEG-PHP and both the installation were successfull.

  46. Rizwan says:

    hi, i have already installed AMR and during the installation of ffmpeg , i find this error

    libamr is nonfree and –enable-nonfree is not specified.

    Need guidance about this error
    Thank you very much.

  47. Rizwan says:

    hi Hitesh, i have used the above comand as well like this, but now found this error
    ./configure –enable-libmp3lame –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared –enable-nonfree
    ERROR:libamrwb not found

    i have already installed AMR.

    Thankyou very much in advance.

  48. paresh says:

    Hi,

    I have started the installation from line 1.

    Note: I have download all the tar files and place it /home/pkendre/Doc folder.

    Step: 1.
    I have successfully completed installation of LAME MP3 Encoder.

    Step: 2.
    I have
    Now I have to Install “AMR Codec”, what i have conclude before install AMR Codec, i have to install autoConf.
    because for ./configure i am getting following error.


    configure: error: You need patch utility to prepare sources.

    So, I have downloaded both the files “amrwb-7.0.0.3.tar.bz2″ and “amrnb-7.0.0.2.tar.bz2″, I have placed this two files in /home/pkendre/Doc folder.

    Then could you please tell me how to install autoConf?

  49. Rizwan says:

    hi Hitesh, i have solved the above ERROR by installing amrwb again.
    But now i found this error

    ./configure –enable-libmp3lame –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared –enable-nonfree
    ERROR:libxvid not found

    i have reinstalled the xvid audio codec successfully,But still found this error during the installation of ffmpeg ??

    thankyou very much in advance for your guidance.

    • Hi Rizwan,
      You have selected –enable-libxvid in FFMPEG configuration. You need to have XVID library installed in your system. FFMPEG did not find the xvid library that why it is throwing error. If you dont require xvid library than remove it from configure parameter.

      Hitesh Agarwal

  50. Rizwan says:

    Hi Hitesh,

    i have remove the xvid, now ffmpeg installation is successful by this command,

    ./configure –enable-libmp3lame –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-gpl –enable-shared –enable-nonfree

    But when i used this below command for testing then found this error

    [root@abc project]# ffmpeg -i test.mp3 test.flv

    ffmpeg: error while loading shared libraries: libavdevice.so.52:cannot open shared object file: No such file or directory

    I have reinstalled the ffmpeg successfully, but still found this error ?

    Thanxx in advance for guidance.

  51. Paresh says:

    Hello Hitesh,
    I have successfully installed LAME, AMR(both version), XVD, now have started with FFMPEG.
    I have checkout the code, changed the permission, Traverse to the root of ffmpeg folder and finally typed


    ./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared

    but am getting following error,
    Unknown option “–enable-libmp3lame”.

    though i have installed the LAME.

    Could you please tell what additinal things i have to do?

    Thanx in advance for guidance.

  52. Paresh says:

    Hey Neveo, this is regarding ur comment/post number 36.

    am also facing the same problem,
    Unknown option “–enable-libmp3lame”.

    Did you find out any solution?

  53. Ashish says:

    Hi Hitesh,

    I want to install vhook in ffmpeg. Is there any way to enable vhook capabilities in ffmpeg.
    Also I want to install imlib2. Please can you help me, how can I do it.

    Thanks
    Ashish

  54. Daniel says:

    Hey Hitesh,

    I’m currently trying to install FFmpeg on my centos 5.3 server. When i run it to see if it’s working i get the error

    “ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file, or some other library. ”

    I don’t know anything about linux however so i have not been able to follow along with previous posts. If it’s not a lot to it, could you please tell me step by step, what commands i need to type through the terminal?

    Thanks a lot!
    Daniel

  55. Jorge says:

    Hi, Hitesh.

    I need your help with the installation of ffmpeg-php.
    i have ffmpeg installed. that is the config.
    FFmpeg version SVN-r19082, Copyright (c) 2000-2009 Fabrice Bellard, et al.
    configuration: –prefix=/home/ehrspain/executable –enable-gpl –enable-nonfree –enable-postproc –enable-avfilter –enable-avfilter-lavf –enable-pthreads –enable-x11grab –enable-bzlib –enable-libamr-nb –enable-libamr-wb –enable-libfaac –enable-libfaad –enable-libfaadbin –enable-libmp3lame –enable-libtheora –enable-libvorbis –enable-libxvid –enable-zlib
    libavutil 50. 3. 0 / 50. 3. 0
    libavcodec 52.30. 2 / 52.30. 2
    libavformat 52.34. 0 / 52.34. 0
    libavdevice 52. 2. 0 / 52. 2. 0
    libavfilter 0. 5. 0 / 0. 5. 0
    libswscale 0. 7. 1 / 0. 7. 1
    libpostproc 51. 2. 0 / 51. 2. 0
    built on Jun 4 2009 13:39:09, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
    At least one output file must be specified

    when i try to install ffmpeg-php.0.6.0 with the follow steps.
    % phpize
    % ./configure –with-ffmpeg=/home/ehrspain/executable
    % make
    % make test

    the last command show me these errors.

    /home/ehrspain/executable/bin/php: symbol lookup error: /home/ehrspain/executable/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so: undefined symbol: avcodec_build
    make: [test] Error 127 (ignored)

    My web is under dreamhost.com service. the ffmpeg under line command run good. but i need the ffmpeg-php.
    any ideas ?

    thanks for your help.
    Jorge.

  56. Moiz says:

    Dude need some help with ffmpeg-php

    Everything installed well with ffmpeg, libmp3lame and stuff… now when i do the make for ffmpeg-php i get this error

    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c: In function ‘_php_convert_frame’:
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:202: warning: implicit declaration of function ‘img_convert’
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c: In function ‘_php_crop_frame’:
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:260: warning: implicit declaration of function ‘img_copy’
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c: In function ‘_php_resample_frame’:
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:282: error: ‘ImgReSampleContext’ undeclared (first use in this function)
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:282: error: (Each undeclared identifier is reported only once
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:282: error: for each function it appears in.)
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:282: error: ‘img_resample_ctx’ undeclared (first use in this function)
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:308: warning: implicit declaration of function ‘img_resample_full_init’
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:321: warning: implicit declaration of function ‘img_resample’
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:326: warning: implicit declaration of function ‘img_resample_close’
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c: In function ‘zif_toGDImage’:
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:448: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c: In function ‘zif_ffmpeg_frame’:
    /home/moiz/ffmpeg-php-0.5.3.1/ffmpeg_frame.c:533: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)

    ———————–
    plz help me out

  57. Moiz says:

    Sorry for the above post … i think i got it working. The latest build of ffmpeg-php had the PIX format fixed.

    thanks anyway

  58. shital says:

    Hi all,

    I have tried to install amrweb (amrwb-7.0.0.3) and amrnb (amrnb-7.0.0.2) on Ubuntu. But i got this error : configure: error: You need patch utility to prepare sources.

    I am trying to convert avi , mpg and wav files into flv but not getting voice (sound).

    Please help me out to solve it asap.

  59. Sudhakara Rao says:

    Hitesh,
    I am new for linux server, we need to install ffmpeg and other codec on it. in install perl module i found ffmpeg module which to be install. but i didn’t find other codec files which you said above. How can i install them through WHM only. server details cPanel 11.24.5-R37453 – WHM 11.24.2 – X 3.9
    CENTOS 5.3 i686
    The hostgator people asking $75 to install it.

    Please help me..

  60. Nitin Iyer says:

    I downloaded all the files as mentioned above in the article. I uploaded all of them to a folder on the same level as that of the public_html folder. All files were successfully untared. Then I followed each step as mentioned above. But I still get the error Unknown –enable-libamr-nb. Can any body tell me if the source files are to be placed in any particular folder? Im running all the commands as Root.

  61. Munish says:

    Hi Hitesh,

    i have done with all the things it worked fine but the only problem is that the audio is getting so much of noise. even i used the parameter -absf noise and chnaged the parameters but with no success i appreciate if you pls let me know what would be the best configuration audio parameters for linux.

    Best Regards’
    Munish Dogra

  62. Pingback: PianoFan

  63. utsavi says:

    Hi,

    i have installed ffmpeg successfully.

    # php -i | grep ffmpeg
    ffmpeg
    ffmpeg-php version => 0.6.0-svn
    ffmpeg-php built on => Nov 24 2009 18:42:08
    ffmpeg-php gd support => enabled
    ffmpeg libavcodec version => Lavc52.20.0
    ffmpeg libavformat version => Lavf52.31.0
    ffmpeg swscaler version => SwS0.7.1
    ffmpeg.allow_persistent => 0 => 0
    ffmpeg.show_warnings => 0 => 0

    also add the extention=ffmpeg.so in php.ini file.

    extension_dir = /usr/lib/php/modules
    extension=ffmpeg.so

    extension is loaded and i have checked ffmpeg entry in phpinfo.php file

    when i used ffmpeg in my php script like below,

    $audioffmpeg=’usr/bin/ffmpeg’;
    $encode_cmd = $audioffmpeg -i notify.wav test.mp3;
    exec($encode_cmd) or die (ffmpeg did not work);

    it shows me ffmpeg did not work

    in usr/bin directory there is a entry of ffmpeg so i have used ‘usr/bin/ffmpeg’ path. Also i have check in usr/local/bin but there is no any single file

    i dont know it is path problem or other.

    how would i check n set the exact path in php script?
    how would i use ffmpeg in my php script?

    thanks,
    utsavi

  64. xiejin says:

    Hello .@shital

    You need to install patch !

    Like this :
    yum install patch

    —-good luck ~~

  65. Sayan Acharjee says:

    I was trying to install ffmpeg-php on Fedora9, I’ve downloaded the ffpmeg-php-0.6.0 and used phpize and ./configure –enable-shared –prefix=/usr and both of them worked fine but when I tried to run make I got the following error:
    “make: *** No targets specified and no makefile found. Stop.”

    I tried the same procedure with ffmpeg-php-0.5.1 and ffmpeg-0.5.0 but failed.
    Can anyone help with this. :|

  66. KJ says:

    Got this error loading shared libraries libavdevice.so.52 while using it with Apache.

    How can i solve it as i created an application with web interface which converts the videos. If i convert it from command line it works like champ but if i try to convert from my browser then it gives error loading shared libraries libavdevice.so.52L: cannot open shared object file: No such file or directory

    Any Idea.

    Thanks In Advance

  67. Pingback: libavutil

  68. Pingback: Extracting audio from video

  69. faruk says:

    I have tries to install ffmpeg but it says -enable version3 is not supported.

    libopencore_amrnb is version3 and –enable-version3 is not specified.

  70. Vivekanand Mishra says:

    Thanks dude.. It helped lot to me.. Finally i got success with help of this article. hurrayy…

  71. Jason Guan says:

    @xiejin
    hi, I have installed patch on my linux, but there is no vhook installed.
    :(

  72. Shahzad says:

    I got stuck at FFMPEG configuration. I am getting this error

    Unknown option “–enable-libogg”.
    See ./configure –help for available options.

    Can anyone help me?

    • Hi Shahzad,
      If you do not require ogg file conversion in your FFMPEG than just remove this option from configure. Otherwise you will have to go through list of options available in “./configure -help” and check for ogg options.

      Thanks,
      Hitesh Agarwal

  73. rajesh says:

    i have installed ffmpeg0.6.1.tar.gz and i have not installed any other packages like lamemp3 andxvid codec .i am facing problem while getting audio file from video .i am installing it on guest folder and i have no root privileges.can u tell me the steps for installing total ffmpeg with all packages and with a player

  74. Dionysius says:

    AAAAAH! IMPORTANT! I FOUND IT OUT.

    This problem could you fix, wenn your ffmpeg command works in SSH, but not in PHP with exec for example.

    First, look everytime at your servers error_log.

    if you have: ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

    put in your php file which uses ffmpeg:
    @putenv(“LD_LIBRARY_PATH=/usr/local/lib”); // change to your path used by ffmpeg

    you can find out that path by using “printenv” in SSH

    Maybe there’s a way to put that in php.ini?

  75. Nitin ray says:

    thanks for this post i really appreciate your work.

  76. David says:

    I am currently developing on a Mac, and dont have access to linux, but need linux static builds(not-shared) for 32 and 64bit machines as I plan to acces FFMPEG via Java. Is there any site with pre-compiled builds that exists?

  77. Imran says:

    This is really a cool tutorial. Keep it up.

  78. paras patel says:

    hi hitesh

    I want to install vhook in ffmpeg.
    Is there any way to enable vhook capabilities in ffmpeg.
    can you plz help me ?

  79. Pingback: José Arrarte | Audio y video en Java utilizando ffmpeg, Jffmpeg, y JMF | José Arrarte

Leave a Reply