FFmpeg installation on Raspberry Pi Zero W: Undefined references to __atomic

Add the following to the ./configure parameters.

--extra-ldflags="-latomic"

So your command becomes:

./configure --extra-ldflags="-latomic" --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree

On arm platforms with the latest version of "something" installed, I've come across several programs (including ffmpeg) that seem to no longer automatically link the atomic library giving you this or a similar error. I haven't had the time to find out exactly what is causing it or why yet.

The above command manually tells the configure script to include atomic when linking.

Trying to enable the Pi's hardware h264 encoding by any chance?


As I don't know the reason of the above behavior, I can confirm that this happens to me too, on Raspberry Pi 3.

I found a workaround, by installing an oldest package by the next commands:

wget -O ffmpeg-4.1.5.tar.bz2 https://ffmpeg.org/releases/ffmpeg-4.1.5.tar.bz2

tar xvjf ffmpeg-4.1.5.tar.bz2

UPDATE: I found some problems with the installation from source, as Pi Zero f.ex the CPU may be hard float, so you should change some flags before compiling.

if you don't mind a version, install the already precompiled packages by:

sudo apt install ffmpeg -y