Search code examples
linuxamazon-web-servicesyum

Installing ffmpeg on amazon linux - cpp, gcc & libstdc++ dependancies


I'm fairly new to complicated config, & am trying to setup ffmpeg on an amazon linux EC2 instance, using the instruction here...

http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat

... however I've hit a wall when trying the following line...

yum install glibc gcc gcc-c++ autoconf automake libtool

Here's the errors I'm getting...

Package matching glibc-2.5-107.x86_64 already installed. Checking for update.
Package matching autoconf-2.59-12.noarch already installed. Checking for update.
Package matching automake-1.9.6-2.3.el5.noarch already installed. Checking for update.
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: cpp = 4.1.2-54.el5 for package: gcc-4.1.2-54.el5.x86_64
Package cpp is obsoleted by cpp44, but obsoleting package does not provide for requirements
---> Package gcc-c++.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: libstdc++ = 4.1.2-54.el5 for package: gcc-c++-4.1.2-54.el5.x86_64
--> Processing Dependency: libstdc++-devel = 4.1.2-54.el5 for package: gcc-c++-4.1.2-54.el5.x86_64
---> Package libtool.x86_64 0:1.5.22-7.el5_4 will be installed
--> Running transaction check
---> Package gcc.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: cpp = 4.1.2-54.el5 for package: gcc-4.1.2-54.el5.x86_64
Package cpp is obsoleted by cpp44, but obsoleting package does not provide for requirements
---> Package gcc-c++.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: libstdc++ = 4.1.2-54.el5 for package: gcc-c++-4.1.2-54.el5.x86_64
---> Package libstdc++-devel.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: libstdc++ = 4.1.2-54.el5 for package: libstdc++-devel-4.1.2-54.el5.x86_64
--> Processing Dependency: /usr/lib64/libstdc++.so.6 for package: libstdc++-devel-4.1.2-54.el5.x86_64
--> Processing Dependency: /usr/lib64/libstdc++.so.6 for package: libstdc++-devel-4.1.2-54.el5.x86_64
--> Processing Conflict: gcc-4.6.2-1.8.amzn1.noarch conflicts libtool < 2.2.10-4.6.2
--> Processing Conflict: gcc-c++-4.6.2-1.8.amzn1.noarch conflicts libtool < 2.2.10-4.6.2
--> Finished Dependency Resolution
Error: Package: gcc-4.1.2-54.el5.x86_64 (centos)
           Requires: cpp = 4.1.2-54.el5
           Installed: cpp46-4.6.2-2.65.amzn1.x86_64 (@amzn-main)
               cpp = 4.6.2-2.65.amzn1
           Available: cpp-4.1.2-54.el5.x86_64 (centos)
               cpp = 4.1.2-54.el5
               cpp = 4.1.1-52.el5
           Available: cpp44-4.4.6-4.77.amzn1.x86_64 (amzn-main)
               cpp = 4.4.6-4.77.amzn1
           Available: cpp47-4.7.0-5.68.amzn1.x86_64 (amzn-main)
               cpp = 4.7.0-5.68.amzn1
           Available: cpp47-4.7.2-2.69.amzn1.x86_64 (amzn-updates)
               cpp = 4.7.2-2.69.amzn1
Error: Package: libstdc++-devel-4.1.2-54.el5.x86_64 (centos)
           Requires: /usr/lib64/libstdc++.so.6
           Available: libstdc++-4.1.2-54.el5.x86_64 (centos)
               Not found
Error: gcc-c++ conflicts with libtool
Error: gcc conflicts with libtool
Error: Package: gcc-c++-4.1.2-54.el5.x86_64 (centos)
           Requires: libstdc++ = 4.1.2-54.el5
           Installed: libstdc++46-4.6.2-2.65.amzn1.x86_64 (@amzn-main)
               libstdc++ = 4.6.2-2.65.amzn1
           Installed: libstdc++47-4.7.2-2.69.amzn1.x86_64 (@amzn-updates)
               libstdc++ = 4.7.2-2.69.amzn1
           Available: libstdc++-4.1.2-54.el5.i386 (centos)
               libstdc++ = 4.1.2-54.el5
               libstdc++ = 4.1.1-52.el5
           Available: libstdc++44-4.4.6-4.77.amzn1.i686 (amzn-main)
               libstdc++ = 4.4.6-4.77.amzn1
           Available: libstdc++47-4.7.0-5.68.amzn1.i686 (amzn-main)
               libstdc++ = 4.7.0-5.68.amzn1
Error: Package: libstdc++-devel-4.1.2-54.el5.x86_64 (centos)
           Requires: libstdc++ = 4.1.2-54.el5
           Installed: libstdc++46-4.6.2-2.65.amzn1.x86_64 (@amzn-main)
               libstdc++ = 4.6.2-2.65.amzn1
           Installed: libstdc++47-4.7.2-2.69.amzn1.x86_64 (@amzn-updates)
               libstdc++ = 4.7.2-2.69.amzn1
           Available: libstdc++-4.1.2-54.el5.i386 (centos)
               libstdc++ = 4.1.2-54.el5
               libstdc++ = 4.1.1-52.el5
           Available: libstdc++44-4.4.6-4.77.amzn1.i686 (amzn-main)
               libstdc++ = 4.4.6-4.77.amzn1
           Available: libstdc++47-4.7.0-5.68.amzn1.i686 (amzn-main)
               libstdc++ = 4.7.0-5.68.amzn1
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Solution

  • Here is how to install FFMPEG on Linux using a static build.

    A good FAQ is here: https://www.johnvansickle.com/ffmpeg/faq/

    SSH into your instance and become root

    sudo su -
    

    Go to the the /usr/local/bin directory

    cd /usr/local/bin
    

    Inside the /usr/local/bin directory, create an "ffmpeg" directory

    mkdir ffmpeg
    

    Go into the new directory

    cd ffmpeg
    

    Now, open a browser and go to the list of FFMPEG static builds at https://johnvansickle.com/ffmpeg/ and pick the latest version.

    While inside the /usr/local/bin/ffmpeg directory, type the following command to download the static build you have selected

    wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
    

    Now, untar it...

    tar -xzf ffmpeg-git-amd64-static.tar.xz
    

    Run it and check what the latest version is

    ./ffmpeg -version
    

    The output should look something like this

    ffmpeg version N-60675-g8fe1076
    built on Feb 16 2014 05:45:47 with gcc 4.6 (Debian 4.6.3-1)
    configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-
    static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --
    extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --
    disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --
    enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --
    enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --
    enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
    libavutil 52. 64.100 / 52. 64.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 32.101 / 55. 32.101
    libavdevice 55. 9.101 / 55. 9.101
    libavfilter 4. 1.102 / 4. 1.102
    libswscale 2. 5.101 / 2. 5.101
    libswresample 0. 17.104 / 0. 17.104
    libpostproc 52. 3.100 / 52. 3.100
    

    If you want to be able to execute FFMPEG from any directory, simply create a symlink into /usr/bin like this:

    ln -s /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg
    

    The first part (/usr/local/bin/ffmpeg/ffmpeg) is where the file is located after I untarred the file. The second part (/usr/bin/ffmpeg) is where we want the symlink to go

    Now, you should be able to run the command "ffmpeg" from anywhere