site  contact  subhomenews

ffmpeg compiled again for Pi2

October 29, 2016 — BarryK
I recently compiled ffmpeg for the Raspberry Pi2 and Pi3, reported on my blog:
http://bkhome.org/news/201610/ffmpeg-hardware-accel-for-pi2.html

However, I wanted to go through the exercise again, and link Omxplayer and VLC against the same ffmpeg libraries.
I have succeeded with this, but starting at step one, here is how I compiled ffmpeg today.

Firstly, I installed some DEBs that will be needed for Omxplayer:
cpp-4.8 g++-4.8 gcc-4.8 gcc-4.8-base libasan0 libboost1.58-dev libcloog-isl4 libgcc-4.8-dev libssh-4 libssh-dev libstdc++-4.8-dev

ffmpeg will only need libssh out of that lot. Though, I do wish they would update to using libssh2.

I compiled ffmpeg 3.2, which requires SDL2, so installed these DEBs:
libsdl2-2.0-0 libsdl2-dev libsdl2-image-2.0-0 libsdl2-image-dev libsdl2-mixer-2.0-0 libsdl2-mixer-dev libsdl2-net-2.0-0 libsdl2-net-dev libsdl2-ttf-2.0-0 libsdl2-ttf-dev libsndio6.1 libsndio-dev

Then configure, compile and install. Note, I took out all hardware acceleration, including OpenMAX, VAAPI and XVMC, however, left the paths into /opt/vc in case want to bring back OpenMAX acceleration:
# ./configure --prefix=/usr --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-nonfree --enable-pthreads --enable-libvorbis  --enable-shared --disable-static --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --disable-runtime-cpudetect --enable-zlib --disable-debug --enable-bzlib --enable-version3 --enable-ffplay  --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdc1394  --enable-libfreetype --enable-libschroedinger --enable-libvpx --enable-libspeex --enable-libcdio --enable-fontconfig --enable-libbluray --enable-libx265 --enable-pic --disable-libpulse --disable-yasm --enable-thumb --cpu=armv7-a --disable-vdpau --enable-openssl --enable-libtheora --enable-librtmp --enable-libopencv --enable-libmp3lame --enable-libfontconfig --enable-libass --enable-gcrypt --enable-libgsm --enable-libtwolame --enable-libv4l2 --enable-libwebp --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libsmbclient --enable-libopus --disable-ladspa --disable-libcaca --enable-sdl2 --enable-ffplay --disable-armv5te --disable-armv6 --disable-armv6t2 --extra-cflags="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/mmal -I/opt/vc/include/interface/vchiq_arm -I/opt/vc/include/IL -I/opt/vc/include/GLES2" --extra-cxxflags="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/mmal -I/opt/vc/include/interface/vchiq_arm -I/opt/vc/include/IL -I/opt/vc/include/GLES2" --extra-ldflags="-L/opt/vc/lib" --enable-libssh --target-os=linux --enable-muxer=spdif --enable-muxer=adts --enable-encoder=ac3 --enable-encoder=aac --disable-decoder=mpeg_xvmc --disable-doc --enable-protocol=http --enable-hardcoded-tables  --disable-ffserver --disable-vaapi --disable-libxvid --disable-hwaccel=mpeg1_xvmc --disable-hwaccel=mpeg2_xvmc

# make -j3
# new2dir make install
<

That's it. Next step is compile Omxplayer.

Tags: linux