FFmpeg for raspberry GPU




FFMPEG for raspberry GPU

Debian Wheezy for Raspberry Pi comes with FFMPEG, however, the version installed by apt-get isn't compiled to use the native GPU driver so FFMPEG needs to be recompiled to use it.

Cross-compiling FFmpeg for Raspbian

Compiling on Raspberry Pi takes a while. If you cannot wait do cross-compiling

Heatsink

I added heatsinks the Raspberry Pi. Maybe a fan would also be a good idea.


Install dependencies

apt-get install  autoconf libtool checkinstall libssl-dev libmp3lame-dev

Download and compile LibaacPlus

 cd /opt
             wget http://tipok.org.ua/downloads/media/aacplus/libaacplus/libaacplus-2.0.2.tar.gz
             tar -xzf libaacplus-2.0.2.tar.gz
             cd libaacplus-2.0.2
             ./autogen.sh --with-parameter-expansion-string-replace-capable-shell=/bin/bash --host=arm-unknown-linux-gnueabi --enable-static
             make
             make install

Download and compile Libx264

 cd /opt
             git clone git://git.videolan.org/x264
             cd x264
             ./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
             make
             make install

Download and compile LibVPX

 cd /opt
             git clone http://git.chromium.org/webm/libvpx.git
             cd libvpx
             ./configure
             make
             checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default

Download and compile LibRTMP

 cd /opt
             git clone git://git.ffmpeg.org/rtmpdump
             cd rtmpdump
             make SYS=posix
             checkinstall --pkgname=rtmpdump --pkgversion="2:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default

Download and compile FFMPEG (Latest Version)

 cd /opt
             git clone --depth 1 git://git.videolan.org/ffmpeg
             cd ffmpeg
             ./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libaacplus --enable-librtmp --enable-libmp3lame
             make
             make install
            ldconfig

Test installation

 ffmpeg -version
             ffmpeg version git-2015-02-27-a220322 Copyright (c) 2000-2015 the FFmpeg developers
             built with gcc 4.6 (Debian 4.6.3-14+rpi1)
             configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libaacplus --enable-librtmp --enable-libmp3lame
             libavutil      54. 19.100 / 54. 19.100
             libavcodec     56. 26.100 / 56. 26.100
             libavformat    56. 23.106 / 56. 23.106
             libavdevice    56.  4.100 / 56.  4.100
             libavfilter     5. 11.102 /  5. 11.102
             libswscale      3.  1.101 /  3.  1.101
             libswresample   1.  1.100 /  1.  1.100
             libpostproc    53.  3.100 / 53.  3.100