I got it to build with libav support.
I took a hint from the post by Stefan S... THANK YOU.
I was getting this build error: “DSO missing from command line?” I googled and came across this page https://candid.technology/how-to-fix-error-adding-symbols-dso-missing-from-command-line/ giving suggestions about why that error might occur and one of the reasons was in the compile command to "Try switching the library order". So I thought maybe I needed to have the magic--enable-libav LATER in my AUTOBUILD_CONFIGURE_EXTRA="" list just as Stefan S does?
These are all the things I did differently to make it build with libav support:
I changed my config list to these and in this order... basically almost the same as Stefan S:
--disable-ffmpeg_static --disable-libfdkaac_static --disable-libtheora_static --disable-libopus_static --disable-libvorbis_static --disable-libvpx_static --disable-libx264_static --disable-libx265_static --disable-libfdkaac --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --disable-avahi --disable-dbus_1 --disable-bintray_cache --disable-execinfo --disable-hdhomerun_static --enable-hdhomerun_client --enable-libav --enable-pngquant --enable-trace --enable-vaapi --prefix=/usr --ldflags-ldvbcsa --ldflags-ldhomerun --platform=linux --python=python3
I don't know if these next things made any difference...
I also commented out these two lines at the top of the buildTVH.sh
#export LD_LIBRARY_PATH=/opt/vc/lib
#export PKG_CONFIG_PATH=$HOME/ffmpeg_build/lib/pkgconfig
• And manually made the symbolic link again...
# sudo ln -s /usr /opt/vc
• I had also installed these packages earlier...
libavcodec-dev libswresample-dev libavformat-dev libavfilter-dev
... but the build also failed after installing them so installing them surely didn't make it work?
I have the same support/features now as Stefan S except no -mmx and -msse2 which apparently are Intel processor things. Stefan S has "libavresample"!! So his build output didn't have a million warnings like this:
No package 'libavresample' found
CC src/input/mpegts/tsdemux.o
Package libavresample was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavresample.pc'
to the PKG_CONFIG_PATH environment variable
Really I think the TVH code should be updated to stop those dependency warnings because libavresample is not needed to make a successful build.
I made a fresh Ubuntu 22.04 install on my Pi 4, updated it and installed my .deb file like this:
sudo apt-get update
sudo dpkg -i tvheadend_4.3-2038~g5f9404117_arm64.deb
It installed fine, I got the Web UI set-up wizard and TVH runs as a systemd service!
In the end maybe it was moving the --enable-libav further down the list of config options that made it build. No idea why. MMarley has his --enable-libav almost at the beginning of the list and his builds. I have also now left out some options I had in before (e.g: --enable-nvenc --enable-omx and a few others) maybe putting them back in will break it again!
Anyway, thank you to @saen acro especially for all your help and patience!
Flex