FFmpeg

From DreamHost

Jump to: navigation, search
The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.

Contents

Update!!

Hey everyone I was just following the steps below and had a small problem, contacted support about it, and they said "Hey, we decided to start installing it ourselves!". So you don't have to do the stuff below, instead it is in /usr/bin/ffmpeg . So if you're using gallery tell it that ffmpeg is in that directory. If thats not what you need and you want your own custom isntall, well then have fun:

Manual Install of ffmpeg

FFmpeg is an audio and video manipulation library used by Gallery to create movie thumbnails. FFmpeg is available by default for Dreamhost users, but can be easily downloaded and compiled using the following instructions in case your setup requires a more recent version:

  1. Login to SSH as the owner account of your directory
  2. If ~/bin doesn't already exist, enter "mkdir bin" to create it
  3. Enter "chmod 775 bin" to set the correct permissions for the bin directory
  4. If ~/lib doesn't already exist, enter "mkdir lib" to create it
  5. Enter "chmod 775 lib" to set the correct permissions for the bin directory
  6. If ~/tmp doesn't already exist, enter "mkdir tmp" to create it
  7. Enter "chmod 775 tmp" to set the correct permissions for the tmp directory
  8. Enter "export TMPDIR=/home/USERNAME/tmp"
  9. Enter "svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg" to download the ffmpeg program source
  10. Enter "cd ffmpeg" to navigate to the source directory
  11. Enter "./configure --prefix=$HOME --enable-cross-compile --enable-shared"
  12. Enter "make"
  13. Enter "make install"
  14. Enter "cd .." to exit the ffmpeg directory
  15. Enter "rm -rf ffmpeg" to delete the directory and clean up after your compilation

If no errors occur, FFmpeg should now be installed in ${HOME}/bin with supporting libraries in ${HOME}/lib.

Gallery Configuration

Tell Gallery that ffmpeg is located in:

"/home/USERNAME/bin/ffmpeg"

USERNAME is your username (duh)

Php Script For Converting Videos

for a php script, see the wiki article on php-ffmpeg here: php-ffmpeg

External Links

The last two links above got ffmpeg up and and running on a one-click Gallery install in 10 minutes (with no shell access required). Great way to go for those who are uneasy/unfamiliar with SSH.

FFMPEG for Automatic FLV creation

ffmpeg can be used to convert many video files from one format to another. I recently implemented this on a dreamhost server: http://openvlog.mobvcasting.com

Essentially you need the LAME and AMR libraries installed before installing FFMPEG. There are a couple of tricks to compiling FFMPEG following that which involve using switches for extra LD library and extra cflag paths:

./configure --prefix=/path/to/install --enable-mp3lame --extra-cflags=-I/path/to/lame/include --extra-ldflags=-L/path/to/lame/lib --enable-amr_nb --enable-amr_nb-fixed --enable-amr_if2 --enable-amr_wb


Then you need to update your LD_LIBRARY_PATH environment variable to include the new paths and use FFMPEG correctly.

Here is the command I use to generate FLVs:

/path/to/ffmpeg -i /path/to/inputfile.avi -acodec mp3 -ab 32 -ac 1 -ar 44100 /path/to/outputfile.flv

Cat put together this blog entry concerning the above.

Use the following commands on the shell from within the ffmpeg directory. This will download and correctly install the needed AMR libraries from http://www.3gpp.org/ You will need to do all three of the following.

# for --enable-amr
mkdir -p libavcodec/amr_float
wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip
unzip 26104-510.zip
unzip 26104-510_ANSI_C_source_code.zip -d libavcodec/amr_float
# for --enable-amr_nb-fixed
mkdir -p libavcodec/amr
wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip
unzip 26073-510.zip
unzip 26073-510_ANSI-C_source_code.zip -d libavcodec/amr
# for --enable-amr_wb --enable-amr_if2
mkdir -p libavcodec/amrwb_float
wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip
unzip 26204-510.zip
unzip 26204-510_ANSI-C_source_code.zip -d libavcodec/amrwb_float
Personal tools