Unable to install package ha-av

Has anyone found a solution for this error?
I’m having this error after Python migration from 3.9 → 3.10
I first upgraded FFmpeg to 5.1 but that didn’t fix it. (after that I reverted to 4.2).
I tried also building a previous ha-av version (9.2) and that worked, but HA requires version 10.0.0

This is a part of my log:
2023-01-20 11:09:27.306 ERROR (SyncWorker_9) [homeassistant.util.package] Unable to install package ha-av==10.0.0: error: subprocess-exited-with-error

× Building wheel for ha-av (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [5063 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-cpython-310
creating build/lib.linux-armv7l-cpython-310/av
copying av/deprecation.py → build/lib.linux-armv7l-cpython-310/av
copying av/datasets.py → build/lib.linux-armv7l-cpython-310/av
copying av/about.py → build/lib.linux-armv7l-cpython-310/av
copying av/main.py → build/lib.linux-armv7l-cpython-310/av
copying av/init.py → build/lib.linux-armv7l-cpython-310/av
creating build/lib.linux-armv7l-cpython-310/av/video
copying av/video/init.py → build/lib.linux-armv7l-cpython-310/av/video
creating build/lib.linux-armv7l-cpython-310/av/subtitles
copying av/subtitles/init.py → build/lib.linux-armv7l-cpython-310/av/subtitles
creating build/lib.linux-armv7l-cpython-310/av/sidedata
copying av/sidedata/init.py → build/lib.linux-armv7l-cpython-310/av/sidedata
creating build/lib.linux-armv7l-cpython-310/av/filter
copying av/filter/init.py → build/lib.linux-armv7l-cpython-310/av/filter
creating build/lib.linux-armv7l-cpython-310/av/data
copying av/data/init.py → build/lib.linux-armv7l-cpython-310/av/data
creating build/lib.linux-armv7l-cpython-310/av/container
copying av/container/init.py → build/lib.linux-armv7l-cpython-310/av/container
creating build/lib.linux-armv7l-cpython-310/av/codec
copying av/codec/init.py → build/lib.linux-armv7l-cpython-310/av/codec
creating build/lib.linux-armv7l-cpython-310/av/bitstream
copying av/bitstream/init.py → build/lib.linux-armv7l-cpython-310/av/bitstream
creating build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/init.py → build/lib.linux-armv7l-cpython-310/av/audio
copying av/utils.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/stream.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/plane.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/packet.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/option.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/logging.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/frame.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/format.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/error.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/enum.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/dictionary.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/descriptor.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/bytesource.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/buffer.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/init.pxd → build/lib.linux-armv7l-cpython-310/av
copying av/video/stream.pxd → build/lib.linux-armv7l-cpython-310/av/video
copying av/video/reformatter.pxd → build/lib.linux-armv7l-cpython-310/av/video
copying av/video/plane.pxd → build/lib.linux-armv7l-cpython-310/av/video
copying av/video/frame.pxd → build/lib.linux-armv7l-cpython-310/av/video
copying av/video/format.pxd → build/lib.linux-armv7l-cpython-310/av/video
copying av/video/codeccontext.pxd → build/lib.linux-armv7l-cpython-310/av/video
copying av/video/init.pxd → build/lib.linux-armv7l-cpython-310/av/video
copying av/subtitles/subtitle.pxd → build/lib.linux-armv7l-cpython-310/av/subtitles
copying av/subtitles/stream.pxd → build/lib.linux-armv7l-cpython-310/av/subtitles
copying av/subtitles/codeccontext.pxd → build/lib.linux-armv7l-cpython-310/av/subtitles
copying av/subtitles/init.pxd → build/lib.linux-armv7l-cpython-310/av/subtitles
copying av/sidedata/sidedata.pxd → build/lib.linux-armv7l-cpython-310/av/sidedata
copying av/sidedata/motionvectors.pxd → build/lib.linux-armv7l-cpython-310/av/sidedata
copying av/sidedata/init.pxd → build/lib.linux-armv7l-cpython-310/av/sidedata
copying av/filter/pad.pxd → build/lib.linux-armv7l-cpython-310/av/filter
copying av/filter/link.pxd → build/lib.linux-armv7l-cpython-310/av/filter
copying av/filter/graph.pxd → build/lib.linux-armv7l-cpython-310/av/filter
copying av/filter/filter.pxd → build/lib.linux-armv7l-cpython-310/av/filter
copying av/filter/context.pxd → build/lib.linux-armv7l-cpython-310/av/filter
copying av/filter/init.pxd → build/lib.linux-armv7l-cpython-310/av/filter
copying av/data/stream.pxd → build/lib.linux-armv7l-cpython-310/av/data
copying av/data/init.pxd → build/lib.linux-armv7l-cpython-310/av/data
copying av/container/streams.pxd → build/lib.linux-armv7l-cpython-310/av/container
copying av/container/pyio.pxd → build/lib.linux-armv7l-cpython-310/av/container
copying av/container/output.pxd → build/lib.linux-armv7l-cpython-310/av/container
copying av/container/input.pxd → build/lib.linux-armv7l-cpython-310/av/container
copying av/container/core.pxd → build/lib.linux-armv7l-cpython-310/av/container
copying av/container/init.pxd → build/lib.linux-armv7l-cpython-310/av/container
copying av/codec/context.pxd → build/lib.linux-armv7l-cpython-310/av/codec
copying av/codec/codec.pxd → build/lib.linux-armv7l-cpython-310/av/codec
copying av/codec/init.pxd → build/lib.linux-armv7l-cpython-310/av/codec
copying av/bitstream/filter.pxd → build/lib.linux-armv7l-cpython-310/av/bitstream
copying av/bitstream/context.pxd → build/lib.linux-armv7l-cpython-310/av/bitstream
copying av/audio/stream.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/resampler.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/plane.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/layout.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/frame.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/format.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/fifo.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/codeccontext.pxd → build/lib.linux-armv7l-cpython-310/av/audio
copying av/audio/init.pxd → build/lib.linux-armv7l-cpython-310/av/audio
running build_ext
building ‘av.utils’ extension
creating build/temp.linux-armv7l-cpython-310
creating build/temp.linux-armv7l-cpython-310/src
creating build/temp.linux-armv7l-cpython-310/src/av
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include -I/home/homeassistant/.pyenv/versions/3.10.9/include/python3.10 -c src/av/utils.c -o build/temp.linux-armv7l-cpython-310/src/av/utils.o
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:46:6: error: redeclaration of ‘enum AVCodecID’
46 | enum AVCodecID {
| ^~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:215:6: note: originally defined here
215 | enum AVCodecID {
| ^~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:47:5: error: redeclaration of enumerator ‘AV_CODEC_ID_NONE’
47 | AV_CODEC_ID_NONE,
| ^~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:216:5: note: previous definition of ‘AV_CODEC_ID_NONE’ was here
216 | AV_CODEC_ID_NONE,
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:50:5: error: redeclaration of enumerator ‘AV_CODEC_ID_MPEG1VIDEO’
50 | AV_CODEC_ID_MPEG1VIDEO,
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:219:5: note: previous definition of ‘AV_CODEC_ID_MPEG1VIDEO’ was here
219 | AV_CODEC_ID_MPEG1VIDEO,
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:51:5: error: redeclaration of enumerator ‘AV_CODEC_ID_MPEG2VIDEO’
51 | AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:220:5: note: previous definition of ‘AV_CODEC_ID_MPEG2VIDEO’ was here
220 | AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:52:5: error: redeclaration of enumerator ‘AV_CODEC_ID_H261’
52 | AV_CODEC_ID_H261,
| ^~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:221:5: note: previous definition of ‘AV_CODEC_ID_H261’ was here
221 | AV_CODEC_ID_H261,
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:53:5: error: redeclaration of enumerator ‘AV_CODEC_ID_H263’
53 | AV_CODEC_ID_H263,
| ^~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:222:5: note: previous definition of ‘AV_CODEC_ID_H263’ was here
222 | AV_CODEC_ID_H263,
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:54:5: error: redeclaration of enumerator ‘AV_CODEC_ID_RV10’
54 | AV_CODEC_ID_RV10,
| ^~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:223:5: note: previous definition of ‘AV_CODEC_ID_RV10’ was here
223 | AV_CODEC_ID_RV10,
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:55:5: error: redeclaration of enumerator ‘AV_CODEC_ID_RV20’
55 | AV_CODEC_ID_RV20,
| ^~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:224:5: note: previous definition of ‘AV_CODEC_ID_RV20’ was here
224 | AV_CODEC_ID_RV20,
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:56:5: error: redeclaration of enumerator ‘AV_CODEC_ID_MJPEG’
56 | AV_CODEC_ID_MJPEG,
| ^~~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:225:5: note: previous definition of ‘AV_CODEC_ID_MJPEG’ was here
225 | AV_CODEC_ID_MJPEG,
| ^~~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:57:5: error: redeclaration of enumerator ‘AV_CODEC_ID_MJPEGB’
57 | AV_CODEC_ID_MJPEGB,
| ^~~~~~~~~~~~~~~~~~
In file included from src/av/utils.c:811:
/usr/local/include/libavcodec/avcodec.h:226:5: note: previous definition of ‘AV_CODEC_ID_MJPEGB’ was here
226 | AV_CODEC_ID_MJPEGB,
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/arm-linux-gnueabihf/libavcodec/bsf.h:28,
from src/av/utils.c:820:
/usr/include/arm-linux-gnueabihf/libavcodec/codec_id.h:58:5: error: redeclaration of enumerator ‘AV_CODEC_ID_LJPEG’
58 | AV_CODEC_ID_LJPEG,

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ha-av
ERROR: Could not build wheels for ha-av, which is required to install pyproject.toml-based projects
2023-01-20 11:09:27.484 ERROR (MainThread) [homeassistant.setup] Setup failed for stream: Requirements for stream not found: [‘ha-av==10.0.0’].

After I removed /usr/local/include/libavcodec I can build ha-av.!

1 Like

Hi, After upgrading HA Core to 2023.4 (on Raspian OS Buster) I get the error “failed to install package ha-av==10.0.0” and all the above steps didn’t work for me.
Is there a solution to sort out this issue?
Thank you

Here below is the complete log of this error:

Logger: homeassistant.util.package
Source: util/package.py:107
First occurred: 08:15:54 (3 occurrences)
Last logged: 08:20:53

Unable to install package ha-av==10.0.0: error: subprocess-exited-with-error × Building wheel for ha-av (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [97 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-armv7l-cpython-310 creating build/lib.linux-armv7l-cpython-310/av copying av/__init__.py -> build/lib.linux-armv7l-cpython-310/av copying av/about.py -> build/lib.linux-armv7l-cpython-310/av copying av/__main__.py -> build/lib.linux-armv7l-cpython-310/av copying av/deprecation.py -> build/lib.linux-armv7l-cpython-310/av copying av/datasets.py -> build/lib.linux-armv7l-cpython-310/av creating build/lib.linux-armv7l-cpython-310/av/video copying av/video/__init__.py -> build/lib.linux-armv7l-cpython-310/av/video creating build/lib.linux-armv7l-cpython-310/av/bitstream copying av/bitstream/__init__.py -> build/lib.linux-armv7l-cpython-310/av/bitstream creating build/lib.linux-armv7l-cpython-310/av/container copying av/container/__init__.py -> build/lib.linux-armv7l-cpython-310/av/container creating build/lib.linux-armv7l-cpython-310/av/codec copying av/codec/__init__.py -> build/lib.linux-armv7l-cpython-310/av/codec creating build/lib.linux-armv7l-cpython-310/av/filter copying av/filter/__init__.py -> build/lib.linux-armv7l-cpython-310/av/filter creating build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/__init__.py -> build/lib.linux-armv7l-cpython-310/av/audio creating build/lib.linux-armv7l-cpython-310/av/sidedata copying av/sidedata/__init__.py -> build/lib.linux-armv7l-cpython-310/av/sidedata creating build/lib.linux-armv7l-cpython-310/av/data copying av/data/__init__.py -> build/lib.linux-armv7l-cpython-310/av/data creating build/lib.linux-armv7l-cpython-310/av/subtitles copying av/subtitles/__init__.py -> build/lib.linux-armv7l-cpython-310/av/subtitles copying av/error.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/frame.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/format.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/logging.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/dictionary.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/packet.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/stream.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/option.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/bytesource.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/enum.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/plane.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/descriptor.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/utils.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/buffer.pxd -> build/lib.linux-armv7l-cpython-310/av copying av/video/frame.pxd -> build/lib.linux-armv7l-cpython-310/av/video copying av/video/format.pxd -> build/lib.linux-armv7l-cpython-310/av/video copying av/video/codeccontext.pxd -> build/lib.linux-armv7l-cpython-310/av/video copying av/video/reformatter.pxd -> build/lib.linux-armv7l-cpython-310/av/video copying av/video/stream.pxd -> build/lib.linux-armv7l-cpython-310/av/video copying av/video/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/video copying av/video/plane.pxd -> build/lib.linux-armv7l-cpython-310/av/video copying av/bitstream/context.pxd -> build/lib.linux-armv7l-cpython-310/av/bitstream copying av/bitstream/filter.pxd -> build/lib.linux-armv7l-cpython-310/av/bitstream copying av/container/input.pxd -> build/lib.linux-armv7l-cpython-310/av/container copying av/container/pyio.pxd -> build/lib.linux-armv7l-cpython-310/av/container copying av/container/core.pxd -> build/lib.linux-armv7l-cpython-310/av/container copying av/container/streams.pxd -> build/lib.linux-armv7l-cpython-310/av/container copying av/container/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/container copying av/container/output.pxd -> build/lib.linux-armv7l-cpython-310/av/container copying av/codec/context.pxd -> build/lib.linux-armv7l-cpython-310/av/codec copying av/codec/codec.pxd -> build/lib.linux-armv7l-cpython-310/av/codec copying av/codec/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/codec copying av/filter/context.pxd -> build/lib.linux-armv7l-cpython-310/av/filter copying av/filter/graph.pxd -> build/lib.linux-armv7l-cpython-310/av/filter copying av/filter/pad.pxd -> build/lib.linux-armv7l-cpython-310/av/filter copying av/filter/filter.pxd -> build/lib.linux-armv7l-cpython-310/av/filter copying av/filter/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/filter copying av/filter/link.pxd -> build/lib.linux-armv7l-cpython-310/av/filter copying av/audio/frame.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/format.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/codeccontext.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/fifo.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/resampler.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/stream.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/layout.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/audio/plane.pxd -> build/lib.linux-armv7l-cpython-310/av/audio copying av/sidedata/sidedata.pxd -> build/lib.linux-armv7l-cpython-310/av/sidedata copying av/sidedata/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/sidedata copying av/sidedata/motionvectors.pxd -> build/lib.linux-armv7l-cpython-310/av/sidedata copying av/data/stream.pxd -> build/lib.linux-armv7l-cpython-310/av/data copying av/data/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/data copying av/subtitles/codeccontext.pxd -> build/lib.linux-armv7l-cpython-310/av/subtitles copying av/subtitles/subtitle.pxd -> build/lib.linux-armv7l-cpython-310/av/subtitles copying av/subtitles/stream.pxd -> build/lib.linux-armv7l-cpython-310/av/subtitles copying av/subtitles/__init__.pxd -> build/lib.linux-armv7l-cpython-310/av/subtitles running build_ext building 'av.stream' extension creating build/temp.linux-armv7l-cpython-310 creating build/temp.linux-armv7l-cpython-310/src creating build/temp.linux-armv7l-cpython-310/src/av gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/arm-linux-gnueabihf -I/srv/homeassistant/include -I/usr/local/include/python3.10 -c src/av/stream.c -o build/temp.linux-armv7l-cpython-310/src/av/stream.o src/av/stream.c:817:10: fatal error: libavcodec/bsf.h: File o directory non esistente #include "libavcodec/bsf.h" ^~~~~~~~~~~~~~~~~~ compilation terminated. 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 ERROR: Could not build wheels for ha-av, which is required to install pyproject.toml-based projects

I fought with this for a long time trying to keep it working on my Raspbian Buster installation, but in the end the only thing I could do was upgrade to Bullseye. The migration turned out to be a lot less difficult than I had feared. I don’t remember all the details, but I think basically saved a copy of my .homeassistant directory, did a fresh install of Buster, created the python virtual environment for HA, and then restored the backup.

1 Like

I’ve bullseye but the error is the same

On bullseye, do you have libavdevice-dev, libavformat-dev, libavcodec-dev,
libavutil-dev, and libavfilter-dev?

1 Like

Ok, I’ve installed them and the error seems to get away. Nice, thanks!

1 Like

Upgraded to HA 2023.6.0 and get similar problem with ha-av==10.1.0.
If I trying to upgrade it manually:

pip3.11 install --upgrade ha-av
...a lot of logs...
      src/av/codec/codec.c: In function ‘__pyx_pymod_exec_codec’:
      src/av/codec/codec.c:6170:36: error: ‘AV_CODEC_CAP_OTHER_THREADS’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_SLICE_THREADS’?
       6170 |   __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_OTHER_THREADS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L1_error)
            |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
            |                                    AV_CODEC_CAP_SLICE_THREADS
      src/av/codec/codec.c:6170:36: 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

Again in search for solving.

Seventh same problem here.

The same issue when building ha-av==10.1.0.

same issue

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.