Unable to install package ha-av

no 10.0.0 produce the same error on 23.6.x
i will stop updating ha core on buster and wait for bookworm. slowly it becomes too much work for me to keep ha core under buster up to date.
12 june is bookworm release and a few weeks later maybe the next raspbian.

with debian12 you get python11, ffmpeg5 and rustc 1.63 out of the box.

i want to spent my time on doing cool stuff with ha and not on keep it alive :wink: 2023.5.4 is fine

enjoy the great summer!

3 Likes

I totally agree - the problem is that I canā€™t really stop trying as long as I have things to checkā€¦ so eventually I managed upgrading ha-av to 10.1.0. I did that by recompiling ffmpeg (followed Compiling FFmpeg on the Raspberry Pi - Pi My Life Up), with a little help from another thread here (Error Ha AV with 2023.04 - #11 by kexan82).
With the following modifications to the process:

  1. fPIC should be enabled for libvpx (add --enable-pic to its configure command)
  2. ffmpeg needs to be compiled as a shared lib (add --disable-static and --enable-shared to the configure command)
  3. I compiled ffmpeg 4.4 (in the last git command clone release/4.4) it might work also with 5.0 or 6.0 but I didnā€™t try.

After this I can upgrade to ha-av 10.1.0. I can also share the ffmpeg deb file I used, if anyone is interested (but it includes the 32bit libs, I think you guys require the 64bit version).

Now Iā€™m a happy camper running upgraded HomeAssistant core 2023.6.0ā€¦

1 Like

Thanks!

This worked for me to compile ffmpeg version 536cd25 running on RPi armv7l.

There was a problem with the libraries being found. At first, I thought I needed to set LD_LIBRARY_PATH, but that wasnā€™t the solution. I needed to make sure /usr/local/lib was in a file under /etc/ld.so.conf.d . Then,
sudo ldconfig
and a reboot seemed to fix it.

Nice, 536cd25 is 5.0 (5.0.3). If you want to create a deb file you can do it easily using ā€œcheckinstallā€.

Thanks for this, compiling ffmpeg on the rpi4 worked for me also. Ran into the same issue where ha couldnā€™t find the linked libraries and ldconfig was the solution as well.

and again I do not stick to my resolutions :slight_smile:

if someone want to know his ffmpeg version, go to:

https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/e5b5dd6:/RELEASE

and replace the 7 digits with the version number from

ffmpeg -version

ROTFL, me too. Iā€™m actually trying to build ffmpeg from scratch but having some troubles wit zimg and AOM probably because Iā€™m on a aarch64 OS version.

i have only compiled ffmpeg as at the end and disregarded the additions.

Compiling FFmpeg on the Raspberry Pi - Pi My Life Up

donā€™t forget:

ā€“enable-pic
ā€“disable-static
ā€“enable-shared

and when everything is finished to run

ldconfig

1 Like

During compilation of AOM 64 bit i am getting :

[ 31%] Building C object CMakeFiles/aom_av1_encoder.dir/third_party/vector/vector.c.o
[ 31%] Building C object CMakeFiles/aom_av1_encoder.dir/av1/encoder/dwt.c.o
[ 31%] Built target aom_av1_encoder
make: *** [Makefile:149: all] Error 2
pi@raspberrypi4:~/ffmpeg-libraries/aom/aom_build $

using make without -J4 give more details:

/home/pi/ffmpeg-libraries/aom/aom_dsp/arm/sum_neon.h:148:25: error: incompatible types when initializing type ā€˜uint16x8_tā€™ using type ā€˜intā€™
148 | const uint16x8_t a1 = vpaddq_u16(sum[2], sum[3]);

Solved with the hints from @zevele and @00lex! :partying_face:

@Maurizion you probably were fooled, like me, by the fact that we might have a 64bit kernel, but the userland is only 32bit, so all compiles should be done for the 32bit version.

Doing a recap for the newcomers, to fix building of ha-av in HA 2023.6.x on a Core installation on Raspbian OS, you should do only the following part from the aforementioned guide, compiling only ffmpeg with the basic set of libraries (@00lex please correct me if Iā€™m wrong). You should choose the most appropriate Git branch for your scenario altering the --branch release/6.0 option from the git clone command:

sudo apt -y install autoconf automake build-essential cmake doxygen git graphviz imagemagick libasound2-dev libass-dev libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libfreetype6-dev libgmp-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev librtmp-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev libsnappy-dev libsoxr-dev libssh-dev libssl-dev libtool libv4l-dev libva-dev libvdpau-dev libvo-amrwbenc-dev libvorbis-dev libwebp-dev libx264-dev libx265-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb1-dev libxml2-dev lzma-dev nasm pkg-config python3-dev python3-pip texinfo wget yasm zlib1g-dev libdrm-dev

git clone --branch release/6.0 --depth 1 https://github.com/FFmpeg/FFmpeg.git ~/FFmpeg

cd ~/FFmpeg

./configure \
    --extra-cflags="-I/usr/local/include" \
    --extra-ldflags="-L/usr/local/lib" \
    --extra-libs="-lpthread -lm -latomic" \
    --arch=armel \
    --enable-gmp \
    --enable-gpl \
    --enable-libass \
    --enable-libdrm \
    --enable-libfreetype \
    --enable-libmp3lame \
    --enable-libopencore-amrnb \
    --enable-libopencore-amrwb \
    --enable-libopus \
    --enable-librtmp \
    --enable-libsnappy \
    --enable-libsoxr \
    --enable-libssh \
    --enable-libvorbis \
    --enable-libwebp \
    --enable-libx264 \
    --enable-libx265 \
    --enable-libxml2 \
    --enable-mmal \
    --enable-nonfree \
    --enable-version3 \
    --target-os=linux \
    --enable-pthreads \
    --enable-openssl \
    --enable-hardcoded-tables \
    --enable-pic \
    --disable-static \
    --enable-shared

make -j$(nproc)

sudo make install

sudo ldconfig
20 Likes

I get an error on configure step
ERROR: libfdk_aac not found
I removed line

ā€“enable-libfdk-aac \

from configure command and all done successfully. I donā€™t know if it important.
Also ldconfig should be run with sudo.
After that
pip3.11 install --upgrade ha-av
done successfully.
Thank you for brief instruction!

Another error I got in HA journal

Logger: haffmpeg.core
Source: /srv/homeassistant/lib/python3.11/site-packages/haffmpeg/core.py:139
First occurred: 12:08:06 (1 occurrences)
Last logged: 12:08:06

FFmpeg fails [Errno 2] No such file or directory: '/usr/bin/ffmpeg'

Solved by
sudo cp ~/FFmpeg/ffmpeg /usr/bin/

Right, fdk was an optional lib, Iā€™ll edit the post.

Thanks , compiling 32bit has solved the problem!

1 Like

Thank you, this solved the issue. I was able to upgrade ha-av succesfully now and can install and run HA Core 2023.6.1.

1 Like

I have tried doing this several times now, and I still canā€™t get it right. :frowning: Only one thing is confusing me, and that may be why:

You should choose the most appropriate Git branch for your scenario altering the --branch release/6.0 option from the git clone command:

I have Bullseye fully updated with the latest Python 3.11 should the git clone command in the message work for me then? Thatā€™s about all I can think about that I may have done wrong. When Hass finally starts, it uses a lot of CPU, like 30-40 %. Never seen that before. But if I disable Stream (that was probably the last media related thing that wasnā€™t already disabled), it seems to work much better.

Thank you, exactly what I needed. I use HassOS for home to keep things simple, but setting up a special Pi deployment for my toy hauler and havenā€™t setup a core installation in years.

Reason is simple:

  • AV_FRAME_DATA_SEI_UNREGISTERED has been added with FFmpeg 4.4: avutil: add AV_FRAME_DATA_SEI_UNREGISTERED side data type Ā· FFmpeg/FFmpeg@bc8ab08 Ā· GitHub
  • Debian Bullseye provides FFmpeg 4.3: https://packages.debian.org/bullseye/ffmpeg
  • So either ha-av making use of AV_FRAME_DATA_SEI_UNREGISTERED gets reverted, or it wonā€™t be possible to compile it on any Debian version below Bookworm (and many other distros), unless FFmpeg (the development headers) is compiled as well.

If you are just installing it with pip, which is also what HA core does on first service start, then this is only relevant on 32-bit ARM and RISC-V (and other rare architectures), as PyPI provides pre-compiled wheels for x86 and aarch64: https://pypi.org/project/ha-av/#files

For 32-bit ARM Debian and Raspbian (and some Ubuntu versions where library versions match), piwheels is an alternative. But well, it provides Python 3.7 and 3.9 wheels only, until they decide to add support for Bookworm, and as it builds against respective Debian repo libraries, recent builds fail for exactly the same reason: https://piwheels.org/project/ha-av/

I do understand that going with recent dependencies/features is great, sometimes make certain things much easier, and users using distros which natively ship too old software is not an issue of upstream developers. But it would make the life of many 32-bit ARM users much easier if:

Sorry for the code-formatted links, as new users are restricted to 2 links per post.

2 Likes

Thanks man. Save my life

1 Like