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 through installing FFmpeg on Ubuntu Server.
Let’s update all the repos on the host.
apt-get update
Install the required packages 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 an 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 the 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 the 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 the 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 the 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. First, install the required dependencies, then compile and install the supporting libraries and FFmpeg. Once you copy the binary to the executable path, you can access and use FFmpeg for multimedia processing on the server.
FAQs
What is FFmpeg?
FFmpeg is a multimedia framework used to process, convert, record, and stream audio and video files.
How do you check the FFmpeg version?
ffmpeg -version
How do you convert a video using FFmpeg?
ffmpeg -i input.mp4 output.avi
Related Articles
How to Install AVideo/YouPHPTube on Ubuntu Server
Talk to our experts
Looking for the right technology solution for your business?. Our experts can help with web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team here.