Installing ViMP Part 2: Installing the Transcoding Tools

These steps are mostly taken from the ViMP FAQ, with modifications from where I stumbled. I had originally tried to make this one long document, but to avoid a wall of text and getting lost in the middle, I've split it out into three parts: Installing the Web Server, Installing the Transcoding Tools, and Installing ViMP.

Notes:

  • This how-to assumes that you have already installed Ubuntu Server 12.04 LTS, have SSH enabled in order to remotely manage the server, and have followed Part 1 of this tutorial
  • I prefer to use nano as my text editor, because it's stupid simple. Ctrl+W is for search, Ctrl+X is for close/save.
  • I run these commands as sudo. Use sudo su in order to drop into permanent sudo mode.

Installing the Transcoding Tools

  1. Update and remove any installed transcoding packages:

    cd /usr/src
    apt-get update
    apt-get upgrade
    apt-get remove x264 ffmpeg mplayer mencoder

  2. Install some compiling tools:

    apt-get install joe make automake g++ bzip2 unzip patch subversion

  3. Install Win codecs:

    wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
    tar xvjf essential-amd64-20071007.tar.bz2
    mkdir /usr/local/lib/codecs
    cp -Rvp essential-amd64-20071007/* /usr/local/lib/codecs/

  4. Extend the search path for /etc/ld.so.conf:

    nano /etc/ld.so.conf

    Add the following lines (if they aren't there):

    /usr/lib
    /usr/local/lib

    Execute ldconfig

    ldconfig

  5. Install some additional codecs:

    apt-get install libsdl1.2-dev zlib1g-dev libfaad-dev libfaac-dev libgsm1-dev libtheora-dev libvorbis-dev libspeex-dev libopencore-amrwb-dev libopencore-amrnb-dev libxvidcore-dev libxvidcore4 libmp3lame-dev libjpeg62 libjpeg62-dev

  6. Install yasm (used to compile x264):

    wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
    tar xzf yasm-1.2.0.tar.gz
    cd yasm-1.2.0/
    ./configure && make install
    cd ..

  7. Install x264 (replace the XXXXXXX's below with the correct version)

    wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2
    tar xvjf last_stable_x264.tar.bz2
    cd x264-snapshot-XXXXXXXX-XXXX-stable/
    ./configure --enable-shared --enable-pic
    make && make install
    cd ..

  8. Install libvpx:

    wget http://webm.googlecode.com/files/libvpx-v1.2.0.tar.bz2
    tar xvjf libvpx-v1.2.0.tar.bz2
    cd libvpx-v1.2.0
    ./configure --enable-shared --enable-pic
    make
    make install
    cd ..

  9. Install MPlayer/mencoder (for Flash playing and transcoding)

    wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.gz
    tar xvzf MPlayer-1.1.tar.gz
    cd MPlayer-1.1/
    ./configure
    make && make install
    ldconfig
    cd ..

  10. Install ffmpeg:

    wget http://ffmpeg.org/releases/ffmpeg-0.8.10.tar.bz2
    tar xvjf ffmpeg-0.8.10.tar.bz2
    cd ffmpeg-0.8.10
    ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
    --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
    --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis \
    --enable-libvpx --enable-libx264 --enable-libxvid
    make
    make install
    cd ..

    IMPORTANT! Execute ldconfig one more time:

    ldconfig

  11. Install flvtool2

    apt-get install flvtool2

  12. Download qt-faststart from ViMP: http://www.vimp.com/en/web/download-configurations.html. Copy the script to /usr/local/bin/ and make it executable:

    chmod +x /usr/local/bin/faststart_64

  13. Create a cron job for transcoding
    • Open crontab. If it prompts, choose the editor you are most comfortable with. I prefer nano.

      crontab -e

    • Insert this line at the bottom, but ensure there is an additional BLANK line after:

      */1 * * * * /var/www/vimp/scripts/sync_new_uploads.sh > /dev/null 2>&1

  14. Download the ffmpeg presets from here and move them to /usr/local/share/ffmpeg/

That was a long process, but you're done with the transcoding tools! The last step is installing ViMP, and you'll have your very own video sharing site!

Share this

Tags: