Is it possible to build ffmpeg
with decoding support for Raspberry Pi? I’ve read that mmal
can do hardware accelerated decoding on the Raspberry Pi.
I’ve tried on debian 10 x86_64:
./configure
--prefix=${BUILD_DIR}/desktop/${FFMPEG_ARCH_FLAG}
--disable-doc
--enable-cross-compile
--cross-prefix=${CROSS_PREFIX}
--target-os=linux
--arch=${FFMPEG_ARCH_FLAG}
--extra-cflags="-O3 -fPIC $EXTRA_CFLAGS"
--enable-mmal
--enable-omx
--enable-omx-rpi
--enable-shared
--disable-debug
--disable-runtime-cpudetect
--disable-programs
--disable-muxers
--disable-encoders
--disable-bsfs
--disable-pthreads
--disable-avdevice
--disable-network
--disable-postproc
where CROSS_PREFIX=aarch64-linux-gnu-
and FFMPEG_ARCH_FLAG=aarch64
but obviously I get ERROR: mmal not found
. I couldn’t find MMAL to compile and install.
2
Answers
This is possible. You can use this build script, which you will need to run on the Raspberry Pi itself. The part you probably care most about is towards the end:
Note this caveat from RaspberryPi.org:
This makes me think the chances of cross-compiling are low, but you can always give it a shot with this script.
To build ffmpeg with mmal support you need to install the raspberry userland which provides the mmal interface. Note that mmal is not supported on 64bit userland systems (See https://github.com/raspberrypi/userland/issues/688)