Unable to install package ha-av

Home Assistant 2022.9.7
Python 3.9 venv
After each restart I have
Setup of default_config is taking longer than 300 seconds. Startup will proceed without waiting any longer
As I understand it because of:

Sep 28 11:04:20 raspberrypi hass[3635]: 2022-09-28 11:04:20.302 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package ha-av==10.0.0b4: error: subprocess-exited-with-error
Sep 28 11:04:20 raspberrypi hass[3635]:   
Sep 28 11:04:20 raspberrypi hass[3635]:   × Building wheel for ha-av (pyproject.toml) did not run successfully.
Sep 28 11:04:20 raspberrypi hass[3635]:   │ exit code: 1
Sep 28 11:04:20 raspberrypi hass[3635]:   ╰─> [99 lines of output]
Sep 28 11:04:20 raspberrypi hass[3635]:       /tmp/pip-build-env-7fv8qczm/overlay/lib/python3.9/site-packages/setuptools/dist.py:530: UserWarning: Normalizing '10.0.0-beta.4' to '10.0.0b4'
Sep 28 11:04:20 raspberrypi hass[3635]:         warnings.warn(tmpl.format(**locals()))
Sep 28 11:04:20 raspberrypi hass[3635]:       running bdist_wheel
Sep 28 11:04:20 raspberrypi hass[3635]:       running build
Sep 28 11:04:20 raspberrypi hass[3635]:       running build_py
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/__main__.py -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/about.py -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/deprecation.py -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/__init__.py -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/datasets.py -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/bitstream
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/bitstream/__init__.py -> build/lib.linux-armv7l-cpython-39/av/bitstream
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/filter/__init__.py -> build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/subtitles
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/subtitles/__init__.py -> build/lib.linux-armv7l-cpython-39/av/subtitles
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/codec
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/codec/__init__.py -> build/lib.linux-armv7l-cpython-39/av/codec
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/sidedata
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/sidedata/__init__.py -> build/lib.linux-armv7l-cpython-39/av/sidedata
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/__init__.py -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/__init__.py -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/container/__init__.py -> build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/lib.linux-armv7l-cpython-39/av/data
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/data/__init__.py -> build/lib.linux-armv7l-cpython-39/av/data
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/utils.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/logging.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/option.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/stream.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/dictionary.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/frame.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/plane.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/format.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/packet.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/buffer.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/bytesource.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/enum.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/error.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/descriptor.pxd -> build/lib.linux-armv7l-cpython-39/av
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/bitstream/context.pxd -> build/lib.linux-armv7l-cpython-39/av/bitstream
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/bitstream/filter.pxd -> build/lib.linux-armv7l-cpython-39/av/bitstream
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/filter/pad.pxd -> build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/filter/context.pxd -> build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/filter/filter.pxd -> build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/filter/graph.pxd -> build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/filter/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/filter/link.pxd -> build/lib.linux-armv7l-cpython-39/av/filter
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/subtitles/subtitle.pxd -> build/lib.linux-armv7l-cpython-39/av/subtitles
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/subtitles/stream.pxd -> build/lib.linux-armv7l-cpython-39/av/subtitles
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/subtitles/codeccontext.pxd -> build/lib.linux-armv7l-cpython-39/av/subtitles
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/subtitles/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/subtitles
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/codec/context.pxd -> build/lib.linux-armv7l-cpython-39/av/codec
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/codec/codec.pxd -> build/lib.linux-armv7l-cpython-39/av/codec
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/codec/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/codec
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/sidedata/motionvectors.pxd -> build/lib.linux-armv7l-cpython-39/av/sidedata
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/sidedata/sidedata.pxd -> build/lib.linux-armv7l-cpython-39/av/sidedata
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/sidedata/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/sidedata
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/layout.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/stream.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/frame.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/resampler.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/codeccontext.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/plane.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/format.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/audio/fifo.pxd -> build/lib.linux-armv7l-cpython-39/av/audio
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/stream.pxd -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/frame.pxd -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/codeccontext.pxd -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/reformatter.pxd -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/plane.pxd -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/format.pxd -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/video/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/video
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/container/streams.pxd -> build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/container/pyio.pxd -> build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/container/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/container/output.pxd -> build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/container/input.pxd -> build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/container/core.pxd -> build/lib.linux-armv7l-cpython-39/av/container
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/data/stream.pxd -> build/lib.linux-armv7l-cpython-39/av/data
Sep 28 11:04:20 raspberrypi hass[3635]:       copying av/data/__init__.pxd -> build/lib.linux-armv7l-cpython-39/av/data
Sep 28 11:04:20 raspberrypi hass[3635]:       running build_ext
Sep 28 11:04:20 raspberrypi hass[3635]:       building 'av.option' extension
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/temp.linux-armv7l-cpython-39
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/temp.linux-armv7l-cpython-39/src
Sep 28 11:04:20 raspberrypi hass[3635]:       creating build/temp.linux-armv7l-cpython-39/src/av
Sep 28 11:04:20 raspberrypi hass[3635]:       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.9 -c src/av/option.c -o build/temp.linux-armv7l-cpython-39/src/av/option.o
Sep 28 11:04:20 raspberrypi hass[3635]:       src/av/option.c:817:10: fatal error: libavcodec/bsf.h: No such file or directory
Sep 28 11:04:20 raspberrypi hass[3635]:        #include "libavcodec/bsf.h"
Sep 28 11:04:20 raspberrypi hass[3635]:                 ^~~~~~~~~~~~~~~~~~
Sep 28 11:04:20 raspberrypi hass[3635]:       compilation terminated.
Sep 28 11:04:20 raspberrypi hass[3635]:       error: command '/usr/bin/gcc' failed with exit code 1
Sep 28 11:04:20 raspberrypi hass[3635]:       [end of output]
Sep 28 11:04:20 raspberrypi hass[3635]:   
Sep 28 11:04:20 raspberrypi hass[3635]:   note: This error originates from a subprocess, and is likely not a problem with pip.
Sep 28 11:04:20 raspberrypi hass[3635]:   ERROR: Failed building wheel for ha-av
Sep 28 11:04:20 raspberrypi hass[3635]: ERROR: Could not build wheels for ha-av, which is required to install pyproject.toml-based projects

Is there any way to resolve it?

Same error here, except with Python 3.10. For some reason it apparently worked for me with Python-3.9. But I need to upgrade to 3.10 to fix other issues and I don’t know how resolve this one.

Home Assistant 2022.10.5
ha-av==10.0.0b5

Still same problems.

Oct 28 22:55:57 raspberrypi hass[8796]:       building 'av.option' extension
Oct 28 22:55:57 raspberrypi hass[8796]:       creating build/temp.linux-armv7l-cpython-39
Oct 28 22:55:57 raspberrypi hass[8796]:       creating build/temp.linux-armv7l-cpython-39/src
Oct 28 22:55:57 raspberrypi hass[8796]:       creating build/temp.linux-armv7l-cpython-39/src/av
Oct 28 22:55:57 raspberrypi hass[8796]:       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.9 -c src/av/option.c -o build/temp.linux-armv7l-cpython-39/src/av/option.o
Oct 28 22:55:57 raspberrypi hass[8796]:       src/av/option.c:817:10: fatal error: libavcodec/bsf.h: No such file or directory
Oct 28 22:55:57 raspberrypi hass[8796]:        #include "libavcodec/bsf.h"
Oct 28 22:55:57 raspberrypi hass[8796]:                 ^~~~~~~~~~~~~~~~~~
Oct 28 22:55:57 raspberrypi hass[8796]:       compilation terminated.
Oct 28 22:55:57 raspberrypi hass[8796]:       error: command '/usr/bin/gcc' failed with exit code 1
Oct 28 22:55:57 raspberrypi hass[8796]:       [end of output]

Any ideas?

Same problem here.

Home Assistant 2022.11.2
ha-av==10.0.0
ffmpeg 4.1.10-0+deb (Raspberry Pi OS based on Debian Buster)

HA takes a looooong time to load, and “Generic Camera” integration fails to load. I have one camera integrated both as Generic Camera (HD stream), and via MotionEye (in LQ) and motionEye integration works properly.

pip install ha-av also fails at the #include "libavcodec/bsf.h" line.

From the ha-av changelog:


## v10.0.0

Major:

* Add support for FFmpeg 5.0 and 5.1 ([:issue:`817`](https://github.com/PyAV-Org/PyAV/blob/bc4eedd5fc474e0f25b22102b2771fe5a42bb1c7/CHANGELOG.rst#id1)).
* Drop support for FFmpeg < 4.3.

Raspberry Pi OS based on Debian Buster uses FFmpeg 4.1 soooo…

…time to upgrade Raspberry Pi OS to the new version based on Debian Bullseye.

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