Converting TWiT Video/Setting Up On NIX

From The Official TWiT Wiki
Jump to: navigation, search
Info.png This article makes reference to the 'sudo' command when root access is required for a command. If you can't use sudo on your system then replace any reference to it with 'su -c'.


This page describes the process of setting up the conversion process on Debian 'Lenny' Linux 5.0 using free and open source software. The two pieces of software we'll need for this process are ffmpeg (0.5 or later) and MP4Box. In order to install this software you will need root access to your GNU/Linux box.

Installing FFMPEG and MP4Box

Debian

This has only been tested with Debian 'Lenny' 5.0 and may not apply to an earlier version.

  1. Open '/etc/apt.sources.list' as root and add the following lines to the bottom of the file:
    • deb http://http.us.debian.org/debian lenny main
    • deb http://www.debian-multimedia.org stable main
    • deb http://ssl.spaggiari.org:81/ stable main
    • deb-src http://ssl.spaggiari.org:81/ stable main
  2. Install the necessary packages to build ffmpeg
    • $ sudo apt-get update
    • $ sudo apt-get upgrade
    • $ sudo apt-get build-dep ffmpeg
    • $ sudo apt-get install subversion liblame-dev libfaad-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev libmp3lame-dev libtheora-dev libvorbis-dev
  3. Build and install ffmpeg using this guide
  4. Install GPAC with MP4Box
    • To build from source with third party library support issue the following command and then follow this guide.
      • $ sudo apt-get build-dep gpac
    • this fixes an issue when trying to cut mp4 files and it cuts half the time instead of the full time set IE from 0 to 60 seconds instead of from 0 to 120 seconds.

Install cURL On Debian

If you would rather use cURL instead of Wget to capture the stream you can install it with the following command:

$ sudo apt-get install curl

Ubuntu

This has only been tested with Ubuntu 'Intrepid Ibex' 8.10 and may not apply to an earlier version.

  1. Install the necessary packages to build ffmpeg
    • $ sudo apt-get update
    • $ sudo apt-get upgrade
    • $ sudo apt-get build-dep ffmpeg
    • $ sudo apt-get install subversion libfaad-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev libmp3lame-dev libtheora-dev libvorbis-dev git-core yasm build-essential
  2. Build and install x264 from source using this guide after issuing the following command:
    • $ sudo apt-get purge x264 libx264-dev
  3. Build and install ffmpeg using this guide
  4. Install GPAC with MP4Box
    • To install from the repositories
      • $ sudo apt-get install gpac
    • To build from source with third party library support issue the following command and then follow this guide.
      • $ sudo apt-get build-dep gpac

Install cURL On Ubuntu

If you would rather use cURL instead of Wget to capture the stream you can install it with the following command:

$ sudo apt-get install curl

Install FFMPEG From Source

  1. Check out a copy of ffmpeg from their svn server and enter the new directory.
    • $ svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
    • $ cd ffmpeg/
  2. Run the following configure command
    • $ ./configure --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-libvorbis
  3. Build and install ffmpeg (depending on your machine this may take several minutes)
    • $ make
    • $ sudo make install

Install MP4Box From Source

  1. Download GPAC and the GPAC third party libraries
    • $ wget http://downloads.sourceforge.net/gpac/gpac-0.4.5.tar.gz
    • $ wget http://downloads.sourceforge.net/gpac/gpac_extra_libs-0.4.5.tar.gz
  2. Extract both tar.gz archives
    • $ tar xzf gpac-0.4.5.tar.gz
    • $ tar xzf gpac_extra_libs-0.4.5.tar.gz
  3. Copy the gpac_extra_libs/ directory into the gpac/ directory so they will be compiled together and enter gpac/ directory.
    • $ cd gpac_extra_libs
    • $ cp -rf * ../gpac/extra_lib
    • $ cd ../gpac/
  4. Build the GPAC library and MP4Box. Depending on your system this may take several minutes.
    • $ chmod a+x ./configure
    • $ ./configure
    • $ make lib
    • $ make apps
  5. Install MP4Box and the GPAC library (this will ask for your root password).
    • $ sudo make install

Installing x264 From Source

  1. Check out a copy of x264 and enter the new directory
  2. Configure, build and make x264
    • $ ./configure --enable-pthread --enable-shared
    • $ make
    • $ sudo make install