Powered by eUKhost®

Announcement

Collapse
No announcement yet.

How To Install FFmpeg + FFmpeg-PHP + Mplayer + Mencoder + flv2tool + LAME MP3 Encoder

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

  • How To Install FFmpeg + FFmpeg-PHP + Mplayer + Mencoder + flv2tool + LAME MP3 Encoder

    Hello,

    Following are the steps to install FFmpeg + FFmpeg-PHP + Mplayer + Mencoder + flv2tool + LAME MP3 Encoder + Libog on a Linux server or VPS Hosting Manually. There are many automated scripts available which install these but its better to do it manually as in case of an error occuring during the installation process, we can stop the installation and fix them. These steps also include the common fixes for such errors.

    cd /usr/local/src/

    DOWNLOAD MODULES

    wget http://www.mplayerhq.hu/MPlayer/rele...061022.tar.bz2
    wget rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
    wget easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
    wget superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.1.tbz2
    wget downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
    wget downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz

    EXTRACT MODULES

    tar zxvf lame-3.97.tar.gz
    tar zxvf libogg-1.1.3.tar.gz
    tar zxvf libvorbis-1.1.2.tar.gz
    tar zxvf flvtool2_1.0.5_rc6.tgz
    tar jxvf essential-20061022.tar.bz2
    tar jxvf ffmpeg-php-0.5.1.tbz2

    mkdir /usr/local/lib/codecs/

    yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran subversion ruby ncurses-devel -y

    DOWNLOAD FFMPEG and MPLAYER

    svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
    svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
    cd /usr/local/src/mplayer

    svn update

    cd /usr/local/src/
    mv /usr/local/src/essential-20061022/* /usr/local/lib/codecs/
    chmod -R 755 /usr/local/lib/codecs/

    LAME:

    cd /usr/local/src/lame-3.97
    ./configure
    make && make install

    LIBOGG

    cd /usr/local/src/
    cd /usr/local/src/libogg-1.1.3
    ./configure --enable-shared && make && make install
    PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    export PKG_CONFIG_PATH

    LIBVORBIS

    cd /usr/local/src/
    cd /usr/local/src/libvorbis-1.1.2
    ./configure && make && make install

    FLVTOOL2

    cd /usr/local/src/
    cd /usr/local/src/flvtool2_1.0.5_rc6/
    ruby setup.rb config
    ruby setup.rb setup
    ruby setup.rb install

    MPLAYER

    cd /usr/local/src/
    cd /usr/local/src/mplayer
    ./configure && make && make install

    cd /usr/local/src/

    FFMPEG:

    cd /usr/local/src/ffmpeg/
    ./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
    make
    make install

    export LD_LIBRARY_PATH=/usr/local/lib/

    ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
    ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
    ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
    ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
    ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

    FFMPEG-PHP:

    cd /usr/local/src/
    cd /usr/local/src/ffmpeg-php-0.5.1/
    phpize
    ./configure
    make
    make install


    NOTICE: Make sure this is the correct php.ini for the box!!

    echo 'extension=ffmpeg.so' >> /usr/local/Zend/etc/php.ini

    NOTICE: Make sure this is the correct php.ini for the box!!

    RESTART APACHE

    service httpd restart
    That's all

    Last edited by eUK-Victor; 12-01-2012, 20:42. Reason: spelling mistake
    vzAddict || Mike :cool:

    eUKHost on ||

  • #2
    Hey Mikey... Nice one Keep it up..
    Rock _a.k.a._ Jack Daniel

    Follow eUKhost on Twitter || Join eUKhost Community on Facebook

    Comment


    • #3
      Hello,

      While installing FFMPEG-PHP sometime it gives following error:
      checking for ffmpeg support... yes, shared
      checking for ffmpeg headers... configure: error: ffmpeg headers not found. Make sure you've built ffmpeg as shared libs using the --enable-shared option
      To fix this problem just copy and paste the following commands on the shell of your server and re-run the “./configure” for FFMPEG-PHP:
      mkdir /usr/local/include/ffmpeg
      cp /usr/local/include/libavcodec/* /usr/local/include/ffmpeg
      cp /usr/local/include/libavdevice/* /usr/local/include/ffmpeg
      cp /usr/local/include/libavformat/* /usr/local/include/ffmpeg
      cp /usr/local/include/libavutil/* /usr/local/include/ffmpeg
      cp /usr/local/include/libswscale/* /usr/local/include/ffmpeg
      vzAddict || Mike :cool:

      eUKHost on ||

      Comment


      • #4
        MPLAYER

        cd /usr/local/src/
        cd /usr/local/src/mplayer

        ./configure && make && make install

        I am getting error after running above command..

        error is :

        libmpdemux/demux_lavf.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'mp_seek'
        libmpdemux/demux_lavf.c: In function 'lavf_check_preferred_file':
        libmpdemux/demux_lavf.c:190: warning: initialization from incompatible pointer type
        libmpdemux/demux_lavf.c: In function 'demux_open_lavf':
        libmpdemux/demux_lavf.c:464: error: 'mp_seek' undeclared (first use in this function)
        libmpdemux/demux_lavf.c:464: error: (Each undeclared identifier is reported only once
        libmpdemux/demux_lavf.c:464: error: for each function it appears in.)
        make: *** [libmpdemux/demux_lavf.o] Error 1


        cd /usr/local/src/

        Comment


        • #5
          It appears like that the installer you downloaded is incorrect/corrupt, can you re-download a fresh copy of the packages & try reinstalling them ?
          Rock _a.k.a._ Jack Daniel

          Follow eUKhost on Twitter || Join eUKhost Community on Facebook

          Comment


          • #6
            While installing FFMPEG on a server when we run “make” after “./configure” it gives following error:
            math-errno -c -o libavdevice/v4l.o libavdevice/v4l.c
            In file included from libavdevice/v4l.c:32:
            /usr/include/linux/videodev.h:56: error: syntax error before "ulong"
            /usr/include/linux/videodev.h:72: error: syntax error before '}' token
            libavdevice/v4l.c: In function `grab_read_header':
            libavdevice/v4l.c:77: error: storage size of 'tuner' isn't known
            libavdevice/v4l.c:141: error: invalid application of `sizeof' to incomplete type `video_tuner'
            libavdevice/v4l.c:148: error: invalid application of `sizeof' to incomplete type `video_tuner'
            libavdevice/v4l.c:77: warning: unused variable `tuner'
            make: *** [libavdevice/v4l.o] Error 1
            SOLUTION:

            This problem can be fixed by disabling v41 and v42 for FFMPEG. This can be done when we run “./configure” for FFMPEG
            ./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --disable-demuxer=v4l --disable-demuxer=v4l2
            Once this has been completed run “make” and “make install” to install FFMPEG.
            vzAddict || Mike :cool:

            eUKHost on ||

            Comment


            • #7
              I found a real simple fix to a common issue, and this issue comes when your trying to ./configure ffmpeg, the issue is with the /tmp directory. You can easily make a new tmp dir, just do the following:
              1. cd /usr/local/src
              2. mkdir tmp
              3. chmod 777 tmp
              4. export TMPDIR=/usr/local/src/tmp
              5. cd /usr/local/src/ffmpeg/
              6. ./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared && make && make install

              That fixed the painful process of trying to find why my /tmp directory wasn't letting me install FFMPEG

              Comment


              • #8
                Im getting a few erros when trying to install FFMPEG-PHP:


                /usr/local/src/ffmpeg-php-0.5.1$ make
                /bin/sh /usr/local/src/ffmpeg-php-0.5.1/libtool --mode=compile gcc -I. -I/usr/local/src/ffmpeg-php-0.5.1 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.5.1/include -I/usr/local/src/ffmpeg-php-0.5.1/main -I/usr/local/src/ffmpeg-php-0.5.1 -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.1/ffmpeg_frame.c -o ffmpeg_frame.lo
                gcc -I. -I/usr/local/src/ffmpeg-php-0.5.1 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.5.1/include -I/usr/local/src/ffmpeg-php-0.5.1/main -I/usr/local/src/ffmpeg-php-0.5.1 -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.1/ffmpeg_frame.c -fPIC -DPIC -o .libs/ffmpeg_frame.o
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c: In function `_php_convert_frame':
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:197: warning: implicit declaration of function `img_convert'
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c: In function `_php_crop_frame':
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:250: warning: implicit declaration of function `img_copy'
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c: In function `_php_resample_frame':
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:272: error: `ImgReSampleContext' undeclared (first use in this function)
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:272: error: (Each undeclared identifier is reported only once
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:272: error: for each function it appears in.)
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:272: error: `img_resample_ctx' undeclared (first use in this function)
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:298: warning: implicit declaration of function `img_resample_full_init'
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:311: warning: implicit declaration of function `img_resample'
                /usr/local/src/ffmpeg-php-0.5.1/ffmpeg_frame.c:316: warning: implicit declaration of function `img_resample_close'
                make: *** [ffmpeg_frame.lo] Error 1

                Comment


                • #9
                  Hello,

                  The problem seems to be with the FFMPEG-PHP version (0.5.1) which you are trying to install. Please try to install the latest version of FFMPEG-PHP i.e. 0.6.0 which can be downloaded from: SourceForge.net: Files

                  Please let us know if this fix the issue.
                  vzAddict || Mike :cool:

                  eUKHost on ||

                  Comment


                  • #10
                    Ya that worked great thanks

                    Comment


                    • #11
                      so close, still getting ffmpeg-php.lo error 1

                      tried version of ffmpeg-php 5.1, 5.0, 6.0 5.3.1 no luck

                      any idea why?

                      great solution, just a hair thin away from getting it all done

                      Comment


                      • #12
                        Hi,

                        Please try installing ffmpeg using auto-installer. It will install most of the dependencies automatically. You can download installer from URL http://nchc.dl.sourceforge.net/sourc...all.3.1.tar.gz

                        ------------------------------------------
                        wget http://nchc.dl.sourceforge.net/sourc...all.3.1.tar.gz

                        tar -xvzf ffmpeginstall.3.1.tar.gz

                        cd ffmpeginstall.3.1

                        ./install.sh
                        ------------------------------------------
                        Scott M
                        System Administrator

                        || ||

                        Comment


                        • #13
                          FLVTOOL2

                          cd /usr/local/src/ .................................................. ....OK
                          cd /usr/local/src/flvtool2_1.0.5_rc6/...........................OK
                          ruby setup.rb config..........................................-bash: ruby: command not found

                          I think it is a simple problem but i dont have any idea why this command doesnt work. All the other steps was allright


                          I need help about this command

                          TNX

                          Comment


                          • #14
                            Originally posted by doncamillo View Post
                            FLVTOOL2

                            cd /usr/local/src/ .................................................. ....OK
                            cd /usr/local/src/flvtool2_1.0.5_rc6/...........................OK
                            ruby setup.rb config..........................................-bash: ruby: command not found

                            I think it is a simple problem but i dont have any idea why this command doesnt work. All the other steps was allright


                            I need help about this command

                            TNX
                            Hi,

                            You need to install Ruby first if you're running the ruby command. Try running "yum install ruby" from the SSH, it'd be sorted out
                            Rock _a.k.a._ Jack Daniel

                            Follow eUKhost on Twitter || Join eUKhost Community on Facebook

                            Comment


                            • #15
                              Originally posted by eUK-Scott View Post
                              Hi,

                              Please try installing ffmpeg using auto-installer. It will install most of the dependencies automatically. You can download installer from URL ttp://nchc.dl.sourceforge.net/sourceforge/ffmpeginstall/ffmpeginstall.3.1.tar.gz

                              ------------------------------------------
                              wget nchc.dl.sourceforge..........e/ffmpeginstall/ffmpeginstall.3.1.ta

                              tar -xvzf ffmpeginstall.3.1.tar.gz

                              cd ffmpeginstall.3.1

                              ./install.sh
                              ------------------------------------------
                              I had the same problem and did evrything that you told in the above.
                              Now i wonder is this for only FFMPEG install or both FFMPEG and FFMPEG-PHP.

                              Shortly i wonder should i continue the FFMPEG_PHP step of the first post. Or it is done now?

                              What should i do now?

                              Comment

                              ban-img
                              Working...
                              X