Introduction
This post guides you through the process of installing FFmpeg on an Ubuntu server. FFmpeg is a powerful multimedia framework that can be used to record, convert, and stream audio and video files. The following steps explain how to install the required dependencies, download the necessary libraries, compile FFmpeg, and make the FFmpeg binary available from the executable path.
Prerequisites
Before proceeding with the installation, make sure you have:
- An Ubuntu server.
- Root or sudo access to the server.
- A stable internet connection.
- Sufficient disk space to download and compile the required packages.
- Basic knowledge of Linux commands.
Implementation
This post guides you to install ffmpeg on ubuntu server.
Let’s update all the repo’s on the host.
apt-get update
Install the required package using apt-get install.
apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev yasm libx264-dev unzip libopus-dev libmp3lame-dev
Create a ffmpeg installation directory.
mkdir /usr/local/src/ffmpeg cd /usr/local/src/ffmpeg
Download and install.
wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master unzip fdk-aac.zip cd mstorsjo-fdk-aac* autoreconf -fiv ./configure --prefix="$HOME/ffmpeg_build" --disable-shared make make install
Install libpvx package.
wget http://webm.googlecode.com/files/libvpx-v1.3.0.tar.bz2 tar xjvf libvpx-v1.3.0.tar.bz2 cd libvpx-v1.3.0 PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples PATH="$HOME/bin:$PATH" make make install
Install libogg package.
curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz tar xzvf libogg-1.3.2.tar.gz cd libogg-1.3.2 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared make make install
Install ffmpeg package.
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" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree PATH="$HOME/bin:$PATH" make make install
Copy the binary to executable path
cp /usr/local/src/ffmpeg /usr/sbin
Conclusion
By following the above steps, you can install FFmpeg and its required libraries on an Ubuntu server. The required dependencies are installed first, followed by the compilation and installation of the supporting libraries and FFmpeg. Once the binary is copied to the executable path, FFmpeg can be accessed and used for multimedia processing on the server.