Forums

Installing ffmpeg

Hi,

I'm looking to install ffmpeg, but since I cannot use apt packaging I was wondering if it is possible to have it installed for me by one of the admins. I used the search but all I found was a topic where the response was that the user can 'maybe' compile it from source himself. I specifically need ffmpeg, not avconv. Let me know if this is a possibility.

Kind regards, Thomas

Not right now, unfortunately. Our system image is based on Ubuntu 14.04 LTS (we're currently working on something that will change that) and ffmpeg was removed from the system packages prior to that release. Apparently they re-introduced it for 15.04, so when we switch over to 16.04 LTS we'll be able to install it -- but that's some way away.

Thank you for the reply Giles.

Is there any guide available how it compile it myself on Pythonanywhere with my user privileges?

Kind regards, Thomas

There's no official guide, but I was able to follow the instructions on their guide to compiling ffmpeg on Ubuntu with a couple of minor changes:

  • I skipped all of the sudo apt-get install steps. Almost everything was already there.
  • In the cases where there were "If your repository provides XXX, sudo apt-get install it, otherwise compile it using this set of commands", I did the latter. (Two of those "compile" cases, libx265 and libmp3lame, had skippable apt-get installs in them.)
  • I was unable to install libfdk-aac

The last one, and the fact that we don't have libass-dev installed, meant that when I built ffmpeg I configured it without libass and libfdk-aac.

Here's the complete set of commands I ran (though I recommend you follow the ffmpeg page rather than blindly following these):

mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
cd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --disable-opencl
PATH="$HOME/bin:$PATH" make
make install
cd ~/ffmpeg_sources
hg clone https://bitbucket.org/multicoreware/x265
cd ~/ffmpeg_sources/x265/build/linux
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install
cd ~/ffmpeg_sources
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared
make
make install
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gzcd ~/ffmpeg_sources
wget http://downloads.xiph.org/releases/opus/opus-1.1.4.tar.gz
cd ~/ffmpeg_sources
wget http://downloads.xiph.org/releases/opus/opus-1.1.4.tar.gz
tar xzvf opus-1.1.4.tar.gz
cd opus-1.1.4
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
cd ~/ffmpeg_sources
wget http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.6.1.tar.bz2
tar xjvf libvpx-1.6.1.tar.bz2
cd libvpx-1.6.1
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests
PATH="$HOME/bin:$PATH" make
make install
cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure   --prefix="$HOME/ffmpeg_build"   --pkg-config-flags="--static"   --extra-cflags="-I$HOME/ffmpeg_build/include"   --extra-ldflags="-L$HOME/ffmpeg_build/lib"   --bindir="$HOME/bin"   --enable-gpl   --enable-libfreetype   --enable-libmp3lame   --enable-libopus   --enable-libtheora   --enable-libvorbis   --enable-libvpx   --enable-libx264   --enable-libx265   --enable-nonfree
PATH="$HOME/bin:$PATH" make
make install

BTW I should say -- the end result of this was a successful compilation, and what looked like an OK set of binaries in ~/bin, but I haven't tested them to check that they work...

Thanks for the info, I'm going to take it for a test drive.

I just followed these instructions, and I see the /bin folder, and the /bin folder has the 'ffmpeg' file in it, but when I run 'ffmpeg' the command isn't recognized, even if I'm within the /bin folder when I run the command.

Update: I'm able to get ffmpeg to run from within the /bin directory by running ./ffmpeg

Update 2 I was able to get it working. I needed to add the /bin folder to the PATH. I did "echo $PATH" to get the current path, copied that to Notepad (on my computer), did a "pwd" from within the /bin folder to get the full path to that folder, copied that and added it to the end of the PATH I'd copied to Notepad (with a colon separating it from what came before), and then did "export PATH=(updated full PATH copied from Notepad)".

Glad you got it working! Thanks also for posting the details about the PATH, that should be useful for other people doing the same thing.

[edit] had misread the instructions.

Hello, I am unable to get FFmpeg installed. I get a 403 forbidden at

wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2

If you've recently upgraded, make sure that you run that in a console that you created after you upgraded.