New modules PyTurboJPEG and ha-av installed on first HA core start

Since one of the recent releases, the first start of the HA core process installs a lot more and “heavier” Python modules than before, notably PyTurboJPEG and ha-av, which pull in g++ and the whole set of FFmpeg A/V library headers as (new) dependencies and significantly increase the time until the web interface is finally reachable.

Does someone know why those are now installed even that no video/audio features/integrations are installed yet?

According to the requirements_all.txt:

# homeassistant.components.camera
# homeassistant.components.stream
PyTurboJPEG==1.6.7

# homeassistant.components.generic
# homeassistant.components.stream
ha-av==10.0.0

homeassistant.components.generic sounds like it was always used, but it switched to ha-av already with 2022.07 an I’m pretty sure that libavdevice-dev etc were not required yet last year.

Is there probably a chance to move some dependencies to be installed on demand when actual media-related integrations are installed and keep HA core itself slim and easier/faster to install?

ha-av==10.0.0 has pre-built wheels for many archs - see ha-av · PyPI

Not sure what you are running on?

No armv7l and armv6l wheels, like common on PyPI, and piwheels does not support Python 3.10 and Python 3.11 yet.

The beauty of the other 3 install methods I guess :slight_smile:

Sure, but they have their own limitations are are not always suitable (I do not want to discuss this here :wink:).

So my question is not so much whether there are pre-compiled wheels available in the one or the other way, but whether these modules are really needed already for the bare HA web interface now, without having any A/V related integration installed.

It is a long time since I used core, but it does seem silly to drag in requirements that you aren’t going to use.

Hence I thought it may be a mistake/bug. If not, then I guess only a tiny function of each library is now used by the core and it may be at least worth it to reconsider whether it makes sense to pull in a huge dependency for a tiny use.