Linux and Open Source Blog

  • Home
  • WordPress Plugins
  • About
  • Contact

Installing ffmpeg on dreamhost

Posted on November 6, 2007 by Linewbie.com Posted in guides, how to .
Facebook0
Google+0
Twitter0
Pinterest0

On Friday I went through the process of installing ffmpeg on dreamhost. Ffmpeg is a free, open source multimedia system and command line tool that can be used to encode and decode from and to several different sources. My interest in using FFmpeg, as aformentioned, is to be able to convert incoming 3gp video from mobile phones to flash video and extract thumbnails of each video uploaded. In order to use ffmpeg to convert to Flash video, however, you also have to download and install LAME, an open source MP3 encoder (which may be illegal…but does it really matter?). Ffmpeg does not support MP3 audio, which is what flash uses. Before installing ffmpeg, you should download and install lame.

As a rule, dreamhost does not allow individuals to install anything with the path /usr/local/lib/ so you have to use the –exec-prefix and –prefix command in the configuration: ./configure –exec-prefix=/home/username/lame –prefix=/home/username/lame to install it to a local folder. This is the same with the ffmpeg instalation, however there are a few differences. You have to enable lame as well as amr_nb, amr_nb_fixed, amr_wb and amr_if2. Amr is apparently the audio codec for certain kinds of mobile phone video. We were testing using video from a Nokia 6682 but further testing needs to be done to see what codecs are used by other phones/carriers. In order to enable Amr you have to download the amr software. Unfortunately, I didn’t write down the download urls for amr, but once you issus the following command: ./configure –prefix=/home/username/ffmpeg –enable-mp3lame –extra-cflags=-I/home/username/lame/include –extra-ldflags=-L/home/username/lame/lib –enable-amr_nb –enable-amr_nb-fixed –enable-amr_wb –enable-amr_if2 a message comes up that instructs you on where to go and what location to install the necessary files to.

Unfortunately we ran into a problem early on. The C compiler was failing to compile because it was trying to install ffmpeg to a tmp folder instead of to the ffmpeg folder we had created. In order to prevent this, we had to comment out this section of the configure file:

# set temporary file name
#if test ! -z “$TMPDIR” ; then
# TMPDIR1=”${TMPDIR}”
#elif test ! -z “$TEMPDIR” ; then
# TMPDIR1=”${TEMPDIR}”
#else
#TMPDIR1=”/home/username/tmp”
#fi

You also have to make the following changes to the makefile:
CFLAGS = -Wall -I. $(CFLAGS_$(MODE)) -D$(VAD) -DMMS_IO and
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/catmindeye/lame/lib (which tells ffmpeg where to find the lame files).

With ffmpeg successfully installed, our next step is to include code in our perl popper that converts the incoming video to flash and stores it in the database. Calling ffmpeg from perl can be done using the exec function which allows you to issue a system command. You then can incorporate the following commands: (from Shawn’s Producing Participatpry Media class handout)

ffmpeg -i inputfile -t 0.001 -ss 10 -s 100×100 outputfile%d.jpg (creataes thumnbnails- replace inputfile with the name of your movie file, the number after -t is the duration (in seconds), the number after -ss is the starting point in seconds, the value after -s is the width x height and outputfile is the name of the outputfile. This command will create as many frames of JPEGs as it needs to meet the assigned duration)

ffmpeg -i inputfile -acodec mp3 -ab 32 -ac 1 outputfile.flv (replace inputfile with the name of your movie file, the 32 is the bitrate of the audio, the 1 is the number of audio channels and outputfile.flv is the output file name- make sure you keep .flv)

Once we have tested the converting of video on the fly we will post code.

One thing I forgot to mention…in order for the audio to play correctly when uploaded and converted from 3gp (mobile phones) you have to include -ar 44100 in the following command:

ffmpeg -i inputfile -acodec mp3 -ab 32 -ac 1 outputfile.flv

This was discovered as a result of testing from a Nokia 6682.

Click here to sign up with DreamHost

 

Tags: dream host, Dreamhost, dreamhost ffmpeg, ffmpeg, install ffmpeg, php-ffmpeg .
« ATI Open-Source vs. Closed-Source Performance & AIGLX Performance
Why Linux Will Succeed On The Desktop »

Leave a comment

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

CAPTCHA
Refresh

*

Recent Posts

  • Does an un-confirmed Bitcoin transaction expire?
  • Looting of the Fox: The Story of Sabotage at ShapeShift
  • Decentralization, Scalability, and Fault Tolerance of Bitcoin
  • Stripe will soon accept Bitcoin payments
  • Zynga announces Bitcoin acceptance in game
  • How to import very large sql dump via phpmyadmin
  • How to compare the content of two folders automatically
  • Top 5 reasons to start experimenting with Linux
  • The day our mind became open sourced
  • Mark Shuttleworth wants to turn canonical (ubuntu) into the next Apple Inc.

Categories

  • applications/software (26)
    • browsers (2)
    • development (1)
    • information management (1)
    • Mobility (1)
    • multimedia (5)
    • office suites (2)
    • security (6)
    • servers (6)
    • system (2)
  • audio/video/pics (3)
  • Bitcoin (3)
  • books & literature (1)
  • cms/portals (1)
  • desktop environments (7)
    • gnome (2)
    • kde (5)
  • events/shows (3)
    • interviews (1)
    • people (1)
    • surveys (1)
  • games & gaming (2)
  • general topics (4)
  • guides (112)
    • how to (105)
    • tips (87)
    • tutorials (86)
  • hardware (8)
    • desktop & laptop pc (5)
    • gadgets & mobiles (2)
  • howtoforge (47)
  • internet/web (4)
    • design & development (2)
  • linux and open source blog (49)
  • linux.com (76)
  • linux/unix/os distros (113)
    • debian/ubuntu based (10)
    • mac/osx (2)
    • other distros (3)
  • news (217)
  • open source (8)
    • business & foss (2)
  • other (26)
    • uncategorized (26)
  • Programming (3)
    • PHP (2)
  • quotes & thoughts (10)
  • random stuff (4)
    • cool stuff (3)
    • funny stuff (1)
  • review/preview/tests (7)
  • wordpress/blogging (3)

Archives

  • July 2016
  • April 2016
  • January 2015
  • April 2014
  • January 2014
  • November 2013
  • February 2013
  • November 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • August 2011
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2006

Recent Posts

  • Does an un-confirmed Bitcoin transaction expire?
  • Looting of the Fox: The Story of Sabotage at ShapeShift
  • Decentralization, Scalability, and Fault Tolerance of Bitcoin
  • Stripe will soon accept Bitcoin payments
  • Zynga announces Bitcoin acceptance in game
  • How to import very large sql dump via phpmyadmin
  • How to compare the content of two folders automatically
  • Top 5 reasons to start experimenting with Linux
  • The day our mind became open sourced
  • Mark Shuttleworth wants to turn canonical (ubuntu) into the next Apple Inc.

Categories

  • applications/software (26)
    • browsers (2)
    • development (1)
    • information management (1)
    • Mobility (1)
    • multimedia (5)
    • office suites (2)
    • security (6)
    • servers (6)
    • system (2)
  • audio/video/pics (3)
  • Bitcoin (3)
  • books & literature (1)
  • cms/portals (1)
  • desktop environments (7)
    • gnome (2)
    • kde (5)
  • events/shows (3)
    • interviews (1)
    • people (1)
    • surveys (1)
  • games & gaming (2)
  • general topics (4)
  • guides (112)
    • how to (105)
    • tips (87)
    • tutorials (86)
  • hardware (8)
    • desktop & laptop pc (5)
    • gadgets & mobiles (2)
  • howtoforge (47)
  • internet/web (4)
    • design & development (2)
  • linux and open source blog (49)
  • linux.com (76)
  • linux/unix/os distros (113)
    • debian/ubuntu based (10)
    • mac/osx (2)
    • other distros (3)
  • news (217)
  • open source (8)
    • business & foss (2)
  • other (26)
    • uncategorized (26)
  • Programming (3)
    • PHP (2)
  • quotes & thoughts (10)
  • random stuff (4)
    • cool stuff (3)
    • funny stuff (1)
  • review/preview/tests (7)
  • wordpress/blogging (3)

Archives

  • July 2016
  • April 2016
  • January 2015
  • April 2014
  • January 2014
  • November 2013
  • February 2013
  • November 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • August 2011
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2006
Privacy Policy

Est. 2002

linewbie.com serving the linux and open source community since April 09, 2002

CyberChimps WordPress Themes

© Linux and Open Source Blog