Skip to content

(RPi) Compile FFmpeg with the OpenMAX H.264 GPU acceleration

Amruth Pabba edited this page May 18, 2019 · 3 revisions

Hey, welcome to the FFmpeg tutorial!

This page has instructions on how to compile and install FFmpeg with the OpenMAX driver, which allows you to use the Raspberry Pi GPU for H.264 encoding.

This has only been tested for Raspberry Pi, other ARM SBCs have not been tested yet.

Ensure you have a stable power supply and good network connection. Also make sure you have a few cups of coffee, this might take a while...


The first command you want to run is: cd /home/pi/

This command takes you to home folder.


Run these commands:

sudo apt-get install libomxil-bellagio-dev -y
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree

These commands download FFmpeg and sets the build configuration.


(RPI 2/3) The next command you want to run is: sudo make -j4

(RPi 1, Zero) The next command you want to run is: sudo make

This command builds FFmpeg.


The next command you want to run is: sudo make install

This command installs FFmpeg into your system.


Reboot your Pi for the code to initialize fully. After this, congrats!

You have now successfully installed FFmpeg, with the hardware H.264 encoder plugin, on your Raspberry Pi! Enjoy!