Get FFMPEG source code:
1 2 3 4 5 |
$ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg $ cd ffmpeg $ mkdir dependencies $ cd dependencies/ $ mkdir output |
Compile libx264
1 2 3 4 5 6 |
$ git clone http://git.videolan.org/git/x264.git $ cd x264/ $ ./configure --enable-static --prefix=/home/pi/ffmpeg/dependencies/output/ $ make -j4 (NOTE: this utilizes 4 threads/cores and is not applicable for Raspberry Pi Zero) $ make install $ cd .. |
Compile ALSA
1 2 3 4 5 6 7 |
$ wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.1.tar.bz2 $ tar xjf alsa-lib-1.1.1.tar.bz2 $ cd alsa-lib-1.1.1/ $ ./configure --prefix=/home/pi/ffmpeg/dependencies/output $ make -j4 $ make install $ cd .. |
Compile FDK-AAC
Installing build tools:
1 |
$ sudo apt-get install pkg-config autoconf automake libtool |
Compile fdk-aac
1 2 3 4 5 6 7 8 |
$ git clone https://github.com/mstorsjo/fdk-aac.git $ cd fdk-aac $ ./autogen.sh $ ./configure --enable-shared --enable-static $ make -j4 $ sudo make install $ sudo ldconfig $ cd .. |
Compile FFMPEG
1 2 3 4 5 6 7 8 9 |
$ cd .. $ ./configure --prefix=/home/pi/ffmpeg/dependencies/output --enable-gpl --enable-libx264 --enable-nonfree --enable-libfdk_aac --enable-omx --enable-omx-rpi --extra-cflags="-I/home/pi/ffmpeg/dependencies/output/include" --extra-ldflags="-L/home/pi/ffmpeg/dependencies/output/lib" --extra-libs="-lx264 -lpthread -lm -ldl" $ make -j4 $ make install |
--enable-omx --enable-omx-rpi
: This enables ffmpeg runtime hardware encoding