How to install FFMPEG, Libx264, LibRTMP, LibAACPlus, LibVPX on the Raspberry Pi (Debian “Wheezy” ARMHF)

In the past I’ve had to been required to install FFMPEG for applications such as Serviio or a website like Clipbucket. It can be quite stressful since you could get dependency issues if you tried reading any other tutorials online, since the worst nightmare is if something breaks when you have compiled software using wrong dependencies. But this tutorial should ensure that it’ll work first time.

 UPDATE (12/10/2016): I’ve since updated this tutorial to add two new codecs for FFMPEG. I’ve also changed the FFMPEG repository to the official one rather than VideoLan. I’ve tested this complete tutorial for my Raspberry Pi 3 and it works fine.

Removing any existing dependencies

It’s vital to uninstall everything we’re going to be compiling/installing just in case there have been custom compilations of software that might be corrupted or broken. I’ve had a few errors in the past which resulted in “Illegal Instruction” when executing “ffmpeg” in the terminal.

Just copy and paste this into your terminal and hit enter. Type y and hit enter when necessary.

Downloading the Dependencies

Copy and Paste the commands below. When it asks, type and press Enter. This will download and install everything we need for later on.

Downloading & Compiling FFMPEG AND It’s Modules

Before we get started, we will be working inside a folder within the home directory. It is important not to remove this file in-case you want to uninstall anything later. Type the commands below in order and follow through.

Downloading & Compiling LibaacPlus

Again, type the below commands in order, and then move onto the next step.

Downloading & Compiling Libx264

 Downloading & Compiling LibVPX

NOTE: if you see the command output for “./configure” incorrectly identify the Pi as ArmV7 instead of ArmV6, try running the configure command again with the following parameter;

Downloading & Compiling LibRTMP

Now, before we move on, it’s important to run the command

This will update the system and make it aware of the new packages which have been installed.

Downloading & Compiling Libfaac

When you’re in the nana editor, you will need to go to line 126. Once you’re at that line, make the below code the same as in the file…

Once you’re finished, press CTRL + O to save, and then hit enter, then press CTRL + X to close the editor.

Then carry on…

It’s important to do a reboot just to make sure everything is being recognised and found.

Downloading & Compiling LibFDK-aac

Downloading & Compiling FFMPEG (Latest Version)

NOTE: This took my Raspberry Pi (Model B) around ~2 hours when overclocked to “Turbo” – 1GHz.

Finishing up

Now that FFMPEG has been compiled and installed successfully, we will need to reboot to make sure that everything is working. Type in;

When the Pi boots up, type in “ffmpeg” and you should see an output similar to that of what I get below;

And that’s it! You have now successfully installed FFMPEG on your Raspberry Pi! 🙂

Summary

The Raspberry Pi is a small credit-card sized computer. It’s very low powered and can be powered by a mini-usb cable and USB plug, such as a modern day phone charger. The Raspberry Pi (Model B) has a stock 700Mhz Armv6 processor and 512MB of RAM. The processor can be overclocked in the configuration to a maximum of 1Ghz (WARNING – Overclocking the Pi may void your warranty and break it).

When software utilises FFMPEG, you will see that it may bring the processor usage to 100% on the pi. This will cause the SoC to heat up rapidly unless you have a heatsink or some other form of cooling. At 100% CPU utilisation, the temperature without a heatsink can reach up to 80 Degrees Celsius!

Feel free to comment below and ask any questions!