Install FFMPEG on CentOS 6.x cPanel server

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Install FFMPEG on CentOS 6.x cPanel server

    1. Enable 9xhost and EPEL yum repositories

    The CentOS 6 RPM packages of ffmpeg, mplayer and MP4Box packages are available on 9xhost.net. These RPM packages are copied from ATrpms and RPM Fusion YUM repositories for a simplified installation.

    Some packages on 9xhost YUM repo depend on EPEL repo. To enable EPEL repo, install the epel-release RPM package

    Code:
    rpm -Uvh http://loads.9xhost.info/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
    To enable 9xhost YUM repository, create the file /etc/yum.repos.d/9xhost.repo

    Code:
    nano /etc/yum.repos.d/9xhost.repo
    and add following repository configuration:

    Code:
    [9xhost]
    name=9xhost Packages CentOS 6 - $basearch
    baseurl=http://dl.9xhost.info/yumrepo/centos/6/$basearch/
    enabled=1
    gpgcheck=0
    2. Install ffmpeg mplayer and mencoder

    for x86 (32bit system)
    Code:
    yum install ffmpeg mplayer
    for x86_64 (64bit system)
    Code:
    yum install ffmpeg mplayer --exclude "*.i386"
    Note: there is no separate package for mencoder. It is also provided by mplayer package.

    This will also install various dependency packages like libtheora, libvorbis, libogg, lame, opencore-amr, x264, xvidcore etc.


    3. Install flvtool2
    cPanel has its own ruby installer script. So install ruby using following cPanel script:

    Code:
    /scripts/installruby
    Flvtool2 is available as a Ruby Gems package. Use following gem command to install flvtool2:

    Code:
    gem install flvtool2
    4. Install MP4Box2

    MP4Box is provided by gpac package. Install gpac and its library packages:

    for x86 (32bit system)
    Code:
    yum install gpac gpac-libs
    for x86_64 (64bit system)
    Code:
    yum install gpac gpac-libs --exclude "*.i386"
    5. Install ffmpeg-php

    Ffmpeg-php requires ffmpeg development package. Install it using yum:
    for x86 (32bit system)
    Code:
    yum install ffmpeg-devel
    for x86_64 (64bit system)
    Code:
    yum install ffmpeg-devel --exclude "*.i386"
    Now download the latest ffmpeg-php package:

    Code:
    wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
    Untar this package, build and install it with following commands:

    Code:
    tar xjf ffmpeg-php-0.6.0.tbz2
    cd ffmpeg-php-0.6.0
    sed -i ‘s/PIX_FMT_RGBA32/PIX_FMT_RGB32/g’ ffmpeg_frame.c
    phpize
    ./configure
    make
    make install
    Note: if you doing copy paste in putty or any ssh client then take care of line sed -i ‘s/PIX_FMT_RGBA32/PIX_FMT_RGB32/g’ ffmpeg_frame.c
    when you copy paste this line coma ' will change to dot .


    The make install command will show PHP extensions path where ffmpeg PHP extension is installed:

    Code:
    root@server [~/ffmpeg-php-0.6.0]# make install
    Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
    Now edit php.ini file
    Code:
    nano /usr/local/lib/php.ini
    and make sure that value of extension_dir is set to PHP extension directory as given by above make install command:

    Code:
    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
    Add following line just below extension_dir and this will enable ffmpeg PHP extension:

    Code:
    extension="ffmpeg.so"
    Restart Apache to make this change effective:

    Code:
    /scripts/restartsrv_httpd
    You can verify the status of ffmpeg extension on a PHP info web page or from command line as given below:

    Code:
    root@server [~]# php -i | grep ffmpeg
    ffmpeg
    ffmpeg-php version => 0.6.0-svn
    ffmpeg-php built on => Jun 2 2012 20:48:04
    ffmpeg-php gd support => enabled
    ffmpeg libavcodec version => Lavc52.123.0
    ffmpeg libavformat version => Lavf52.111.0
    ffmpeg swscaler version => SwS0.14.1
    ffmpeg.allow_persistent => 0 => 0
    ffmpeg.show_warnings => 0 => 0
    OLDPWD => /root/ffmpeg-php-0.6.0
    _SERVER["OLDPWD"] => /root/ffmpeg-php-0.6.0
    _ENV["OLDPWD"] => /root/ffmpeg-php-0.6.0
    6. Installation paths

    Following are the file system paths of tools that we installed:

    Code:
    ffmpeg: /usr/bin/ffmpeg
    mplayer: /usr/bin/mplayer
    mencoder: /usr/bin/mencoder
    flvtool2: /usr/bin/flvtool2
    MP4Box: /usr/bin/MP4Box

    Here is we added a 3 min video tutorial



    Tutorial by 9xhost
    Last edited by Sanju Kr; 24.12.12, 16:41.

    WWW.9XHOST.NET

    #2
    Thak You so much for this thread

    Comment


      #3
      FFMPEG for video preview only.

      Some people want ffmpeg for video preview only so i have short the process and and am witing below.

      Code:
      rpm -Uvh http://loads.9xhost.info/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
      To enable 9xhost YUM repository, create the file /etc/yum.repos.d/9xhost.repo

      Code:
      nano /etc/yum.repos.d/9xhost.repo
      and add following repository configuration:

      Code:
      [9xhost]
      name=9xhost Packages CentOS 6 - $basearch
      baseurl=http://dl.9xhost.info/yumrepo/centos/6/$basearch/
      enabled=1
      gpgcheck=0
      2. Install ffmpeg-php

      Ffmpeg-php requires ffmpeg development package. Install it using yum:
      for x86 (32bit system)
      Code:
      yum install ffmpeg-devel
      for x86_64 (64bit system)
      Code:
      yum install ffmpeg-devel --exclude "*.i386"
      Now download the latest ffmpeg-php package:

      Code:
      wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
      Untar this package, build and install it with following commands:

      Code:
      tar xjf ffmpeg-php-0.6.0.tbz2
      cd ffmpeg-php-0.6.0
      sed -i ‘s/PIX_FMT_RGBA32/PIX_FMT_RGB32/g’ ffmpeg_frame.c
      phpize
      ./configure
      make
      make install
      Note: if you doing copy paste in putty or any ssh client then take care of line sed -i ‘s/PIX_FMT_RGBA32/PIX_FMT_RGB32/g’ ffmpeg_frame.c
      when you copy paste this line coma ' will change to dot .


      The make install command will show PHP extensions path where ffmpeg PHP extension is installed:

      Code:
      root@server [~/ffmpeg-php-0.6.0]# make install
      Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
      Now edit php.ini file
      Code:
      nano /usr/local/lib/php.ini
      and make sure that value of extension_dir is set to PHP extension directory as given by above make install command:

      Code:
      extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
      Add following line just below extension_dir and this will enable ffmpeg PHP extension:

      Code:
      extension="ffmpeg.so"
      Restart Apache to make this change effective:

      Code:
      /scripts/restartsrv_httpd
      You can verify the status of ffmpeg extension on a PHP info web page or from command line as given below:

      Code:
      root@server [~]# php -i | grep ffmpeg
      ffmpeg
      ffmpeg-php version => 0.6.0-svn
      ffmpeg-php built on => Jun 2 2012 20:48:04
      ffmpeg-php gd support => enabled
      ffmpeg libavcodec version => Lavc52.123.0
      ffmpeg libavformat version => Lavf52.111.0
      ffmpeg swscaler version => SwS0.14.1
      ffmpeg.allow_persistent => 0 => 0
      ffmpeg.show_warnings => 0 => 0
      OLDPWD => /root/ffmpeg-php-0.6.0
      _SERVER["OLDPWD"] => /root/ffmpeg-php-0.6.0
      _ENV["OLDPWD"] => /root/ffmpeg-php-0.6.0
      Last edited by Sanju Kr; 24.12.12, 16:42.

      WWW.9XHOST.NET

      Comment

      Working...
      X