Unable to install package ha-av

Same problem here with:

  • HA Core 2023.6.0
  • Raspi4
  • Raspbian Bullseye
  • Kernel 6.1.28-v8+ #1651 SMP PREEMPT Wed May 17 14:34:39 BST 2023 aarch64 GNU/Linux
  • Python 3.11 venv
  • Installed packages: ffmpeg, libavdevice-dev, libavformat-dev, libavcodec-dev, libavutil-dev, and libavfilter-dev all at version 4.3.5-0+deb11u1

Can’t find the ha-av 10.1.0 changelog to address the issue, but found that PR on the main PyAv project that mentions the added “AV_CODEC_CAP_OTHER_THREADS” declaration from ffmpeg 6.0 that might have been merged either on the ha-av package, so PROBABLY an update to ffmpeg 6.0 libs and binaries might solve the issue.

EDIT: Found in the full HA changelog the PR #93420 that confirm the aforementioned hypotesis that ha-av 10.1.0 dropped support for ffmpeg 4.3.x (the default on Raspbian OS), so the fix might consist in a downgrade of ha-av, or an upgrade of ffmpeg and needed libs to the 6.x branch.

3 Likes

Also the same issue here on a HA core installation. Running Python 3.10 had the issue and upgraded to 3.11 but the issue still persists.

Running the same setup as GzOnE except for the RPi4 i’m running a 3B+

I have a similar problem (not sure it’s exactly the same), installation fails on ha-av, both during upgrade or manual, but I’m getting the following error (no matter which method):

running pip3.11 install ha-av==10.1.0 ends with the following error:

>  src/av/sidedata/sidedata.c:5662:9: error: ‘AV_FRAME_DATA_SEI_UNREGISTERED’ undeclared (first use in this function)
>        5662 |   if (((AV_FRAME_DATA_SEI_UNREGISTERED != -1L) != 0)) {
>             |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       src/av/sidedata/sidedata.c:5662:9: note: each undeclared identifier is reported only once for each function it appears in
>       error: command '/usr/bin/gcc' failed with exit code 1
>       [end of output]
> 
>   note: This error originates from a subprocess, and is likely not a problem with pip.
>   ERROR: Failed building wheel for ha-av
> Failed to build ha-av
> ERROR: Could not build wheels for ha-av, which is required to install pyproject.toml-based projects

I tried this also with python 3.10.9, 3.11.1 and 3.11.4 - all with the same result.
System is bulleseye running on RPI2 with HA CORE 2023.5.3

Have you tried first to install all ffmpeg dev libs, as suggested this answer in this thread?

Anyways, for the issue with ha-av 10.1.0 on RPiOS Bullseye, i think the only solution will be to replace the distro’s ffpmg version with a manually downloaded and compiled ffmpeg 6.x with all the dev libs. ATM I’ve rolled back to HA 2023.5.4 :frowning_face:

1 Like

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