A few months ago I posted a solution to running Home Assistant with the new uv
1 requirement, but I’ve been getting an error about av
2 not building. The problem is that HA tries to build av
every time it starts up. This takes several minutes and it will always fail.
The underlying issue
The real problem seems to be that av
can’t be built on FreeBSD due to incompatibilities with the version of ffmpeg
available in ports. Until this is fixed we’ll have to find a workaround.
The part of HA that requires av
is actually the stream
module. This is a module for (apparently) allowing efficient streaming of cameras via HA. In my case, all my streams are MJPEG so I’m not terribly worried about performance. I suppose if I was running H.264 streams this would be an issue.
The workaround
So we need to disable the stream
module but this is part of Home Assistant’s default configuration.
This is enabled by the line
default_config:
in the configuration.yaml
file.
So we need to comment it out, but we need to pull in the dependencies this one is bringing in, except the stream
one. The list of dependencies is listed in the integrations page for default_config
.
Here’s a formatted list you can copy and paste. Remove the default_config:
line and replace it with the following
## Disable default_config until av is compatible with FreeBSD
#default_config:
#### begin pull default_config dependencies manually
assist_pipeline:
backup:
bluetooth:
config:
conversation:
dhcp:
energy:
history:
homeassistant_alerts:
cloud:
image_upload:
logbook:
media_source:
mobile_app:
my:
ssdp:
sun:
usb:
webhook:
zeroconf:
# disabled integrations
# stream fails because av fails to build
#stream:
# go2rtc gives an error
#go2rtc:
#### end pull default_config dependencies manually
This should make your Home Assistant start up much faster since it doesn’t try to build av
every time.
Notes
uv
is a pip replacement (a package manager) for Python written in rust. Project repo. ↩︎av
is the pip package name for PyAV (“a Pythonic binding for the FFmpeg libraries”) ↩︎