Install FFmpeg, FFmpeg-PHP, Mplayer, Mencoder, LAME MP3 encoder, FLVtool2, Libvorbis, GD 2, on Linux Ubuntu 8.10 XAMPP 1.7 server

 

This article covers how to install FFmpeg, FFmpeg-PHP, Mplayer, Mencoder, LAME MP3 encoder, FLVtool2, Libvorbis, GD library 2 on a Linux Ubuntu 8.10 Intrepid XAMPP 1.7 Apache web server.

If you are not using XAMPP, there will be some slight differences in the method of doing this and I recommend waiting for a future tutoral I plan on making.

Now this tutorial was created using a new installation of Ubuntu 8.10 Intrepid and already having installed XAMPP 1.7 for Linux. Please do not ask for support on other versions because I'm NOT a developer and I have no way of testing this on any other versions besides the ones used here. I spent several hours learning how to do this and putting it all together, so this is the only method I know. I also don't know a whole lot about troubleshooting this, so if it doesn't work, I may or may not be able to help you. In addition, finding help for it is next to impossible and therefore I can only give you what I know and you'll need to troubleshoot the rest.

There's two versions of this tutorial here; the written guide and the video.

You can use the Written Tutorial located below the video to copy/paste codes to save time and avoid mis-spelling. You may also find it more useful to follow along with.

The Video Tutorial:

 

The Written Tutorial:

  • First we need to uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open terminal and run the following command. Keep terminal open throughout this whole tutorial.
    Code:
    sudo apt-get purge ffmpeg x264 libx264-dev

    • Next we need to get all of the packages we will need to install FFmpeg and x264.
    Code:
    sudo apt-get update

    sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libtheora-dev libxvidcore4-dev libvorbis-dev

     

    INSTALL x264

    • We will get the most current source files from the official x264 git repository.
      You can run ./configure --help to see what other features you can enable or disable.
    Code:
    cd ~/
    sudo -s

    git clone git://git.videolan.org/x264.git

    cd x264

    ./configure --enable-shared

    make

    make install

    ldconfig

     

    INSTALL FFMPEG

    • Now we will get the most recent source files from the official FFmpeg subversion repository.
      You can run ./configure --help to see which options you can enable or disable. You may also leave off whichever options you do not need in the ./configure command.
      ** I also want to note, normally you would add --libogg here, but the recent version(s) of FFmpeg do not contain this option. At the time of writing this tutorial, I do not yet know what kind of impact not having this library enabled may or may not have on video scripts such as phpmotion and others requiring it. **
    Code:
    svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

    cd ffmpeg

    ./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-libvorbis --enable-shared --prefix=/usr

    make clean && make

    make install

    This should complete your FFMPEG installation.

    You may now delete the directories x264 and the ffmpeg that is inside of x264 if you like.
    You may decide to keep them for future compiling if you need to make changes to the options you compiled them with.

     

    INSTALL FFMPEG-PHP FOR UBUNTU 8.10 XAMPP 1.7

    Now we will install FFMPEG-PHP. This is where XAMPP 1.7 will differ from any other Apache installation.

    • Open your Synaptic Package Manager.
    • Install the package php5-ffmpeg and any required dependencies.
    • Now copy ffmpeg.so to your XAMPP php extension directory. You can use this command:
      ** Note: You can use [TAB] to finish typing directory names. Example: /php5/200[TAB] would finish the directory /php5/20060613+lfs/ . This is a MAJOR time saver! **
    Code:
    cp /usr/lib/php5/20060613+lfs/ffmpeg.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/
    • Now re-open your Synaptic Package Manager and remove the following packages:
      apache2-mpm-prefork, php5-gd, php5-ffmpeg, and libapache2-mod-php5

    • Now change the permissions on the php.ini file using this command:
    Code:
    chmod 777 /opt/lampp/etc/php.ini
    • Open /opt/lampp/etc/php.ini with the text editor.
      Now scroll about half way down and find the section containing all of the extensions and add this line:
      extension="ffmpeg.so"
    • Save and close php.ini.
    • Now restart Apache using this command. If it's not running, you may still use this command to start it:
    Code:
    /opt/lampp/lampp restart
    • Now open your browser and go to http://localhost/xampp/ and then click on phpinfo().
      Scroll down and find ffmpeg. It should be between exif and filter.
      ** If it's not there, then you've probably missed something. Verify you copied ffmpeg.so to the correct folder for your php extensions. You may also want to check your Apache error log to see if there was any problems with loading it. **

      If ffmpeg is there, then you've successfully installed ffmpeg-php.

     

    INSTALL MPLAYER, MENCODER, AND FLVTOOL2

    • You many now close Terminal. We will be using the Synaptic Package Manager to install the rest of these.

    • Open your Synaptic Package Manager. Install the package mplayer, mencoder, flvtool2.

    The packages are installed in the following places:

    /usr/bin/flvtool2
    /usr/bin/mplayer
    /usr/bin/mencoder

    ffmpeg is also in this same location:

    /usr/bin/ffmpeg

     

    This completes your install!

    LAME MP3 ENCODER AND GD LIBRARY 2

    LameMP3 encoder was installed in the first step. GD Library version 2 is already installed in Ubuntu 8.10. I'm not sure which package it is installed with, as I had no need to research it. If GD doesn't show up in your phpinfo and you're using Ubuntu 8.10, then please post it in the forum and I will research it and update this tutorial as well as help you find the correct package.

    FINAL NOTES

    As stated before, I really hope this works for you. This is once more the best tutorial I know of on how to do all of this and it actually work. Since I really don't know near as much about Linux as I do Windows (which even that isn't much), I'm not sure how much help I can offer if you encounter problems.

    It was very disappointing to me to find how little support there is on each of these different components. I was very fortunate to happen to come across someone in IRC that helped me overcome the issue with ffmpeg-php. I will later try this on another distribution of Linux, probably Debian.



    Comments
    Add New Search RSS
    Thank you
    Monica Y-m-d H:i:s

    hello, first, I want to thank you for your tutorials, I'm new here and I learn a
    lot about you. Now I want to ask if you can teach me how to put libogg +
    Libvorbis on windows xampp, I need this for my project.
    Thank you very much again.

    Monica
    RE:
    NetworkNerd007 Y-m-d H:i:s

    Hey Monica,
    Thank you very much for your feedback. My article for Windows is located here,
    http://www.myownserver.info/home/step-4-additonal-
    settings/11-installffmpeg.html . It's been several months since I've visited
    this topic, so my memory is a little fuzzy on it. Unless you specifically need
    libogg & Libvorbis, They weren't required for the ffmpeg etc. to work, or were
    included automatically. They are build options and I believe the ffmpeg was
    built with them, but I could be wrong.

    There should be notes somewhere saying how it was compiled, probably from their
    download site. I really don't know much about it and had spent way too much
    time trying to get the video scripts requiring them to work when I had no need
    for the scripts.
    I thought it was a cool idea and no one else had written the full tutorial yet,
    so I spent the time doing so myself so it would help others.

    It's hard for me to offer support on it because of the amount of time it
    requires learning about all of it and the fact I'm not that interested in ffmpeg
    or the scripts that use it.

    I'm sorry that I can't be of much greater help. I do thank you for taking the
    time to leave me feedback and the kind compliments you've left. If you do find
    the answer, please post back.
    Leave feedback
    Name:
    Your email:
     
    Website:
    Message Title:
    Formatting:
    [b] [i] [u] [url] [quote] [code] [img] 
     
    :angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
    :(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
    :!::?::idea::arrow:
    Enter the text as you see it in the image.

    !joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

    Last Updated (Saturday, 08 August 2009 00:33)

     

    !!REMEMBER: Support Forums!!

    I still keep getting requests for support in the comments of posts and unfortunately I cannot give adequate responses due to the fact there's limited space and it just isn't the right place for support.
    I therefore am encouraging visitors to PLEASE go to http://forum.myownserver.info for any support related questions. You will NOT receive any spam or anything you don't specifically subscribe to! I'm very meticulous about this myself and if at any time you need help stopping notifications from posts you previously subscribed to, contact me and I will promptly fix the issue.

    Thank you for your participation in this!

    Open SourceApache HTTP Server ProjectMySQLPHP
    Twitter Feed
    Make a Donation
    This site does not run ads nor does anyone fund it. The owner and author is unemployed and pays for it himself, so if you're feeling generous, please make a donation of any amount to help out. Thank you very much.

    Powered by easy paypal donation

    Survey
    Which is better?
     
    Search
    User Login



    Visitors


    Countries

    30.1%United States United States
    8.4%United Kingdom United Kingdom
    7.7%India India
    4.7%Australia Australia
    4.5%Canada Canada

    Visitors

    Today: 105
    Yesterday: 215
    This Week: 721
    Last Week: 1232
    This Month: 1571
    Last Month: 4992
    Total: 52740


    JoomlaWatch Stats 1.2.9 by Matej Koval