In configure.ac there is the line:
PKG_3RD([ffmpeg],[yes],
[ffmpeg-4.4],
I retried the compilation by removing ffmpeg4.4 and all its patches;
editing configure.ac by adding the line:
AC_CONFIG_MACRO_DIRS([m4])
And changing the one entry with ffmpeg-4.4 to ffmpeg-5.1.
Still crashing.