I tried all the camera platforms so you don't have to

Great post and discussions within the topic. Still years later this post is pretty relevant. I’m new to HA and cameras are one of the use cases I plan on having for my place.

In terms of cameras + other automations (lights and motion sensors) running at the same time, is a Raspberry PI 4 8 gb big enough to run everything at the same time?

Going to take a deep dive into a lot of the tech mentioned in here to continue to learn more. Thanks for everyone’s contribution to this thread :pray::+1:

There are a lot of big ifs in that question. You should be able to support quite a few cameras if you use the stream component or the WebRTC card. But if you use FFMPEG, you will max out the Pi very quickly, maybe after 1 camera.

2 posts were merged into an existing topic: Ffmpeg Issue, half of picture is distorted, proper argument is needed!

Finally merged the LL-HLS PR, but it won’t make it in the 2021.9 release…will have to wait for the 2021.10 beta unless you are comfortable copying the stream code into your components/stream directory

1 Like

Awesome. How much latency do you get with it?

It will depend on the settings used and the camera settings, but on my setup now, using H265+ and a partial segment length of 0.75 seconds, it looks like it’s about 3 seconds (I’m also currently 2000 miles away from my HA instance).

1 Like

Hi, is this PR for all camera platforms? I use the Synology integration

Nice. Is it still only iOS endpoints that will benefit or are there more that work with HLS-LL now?

Hmm, not sure where you got the idea that it was iOS only…iOS was actually the last platform I got working because I don’t have an iOS device to test or develop on. Everything else has been mostly working since I opened the PR back in April.

1 Like

It should work for all integrations that use stream, but I haven’t tested it on anything other than generic.

There was some discussion about limited browser support for HLS-LL further up in the thread and my earlier research had indicated that it might have limited endpoint support, but it’s great to hear that that may not be the case.

It would be amazing if it works on all major platforms! So you didn’t find any where it didn’t work?

It works on all the clients (browsers, safari, android, ios) I have tried, but my sources are all local cameras using the generic integration. Aside from a minor niggle with the android exoplayer implementation and large keyframe intervals, it works very well.
I can’t guarantee it will work all the time especially with non local cameras since the timing tolerances are quite tight and the implementation relies on segmenting behavior from the ffmpeg libraries that we don’t have fine control over - we will probably have to note that in the docs.
Just give it a try when you get a chance.

1 Like

hey @uvjustin , i was testing that PR from : https://github.com/home-assistant/core/pull/49608

loaded it as custom, added verson in manifest
i have the synology camera platform, but i’m unable to see a live view now, as soon as i click on a camera, i have a black screen, thats stuck on loading , this is error below
so my cameras are broken now
removed the PR for now (running 2021.9.4)

2021-09-08 17:18:40 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/config/custom_components/stream/core.py", line 386, in get
    return await self.handle(request, stream, sequence)
  File "/config/custom_components/stream/hls.py", line 108, in handle
    body=self.render(track).encode("utf-8"),
  File "/config/custom_components/stream/hls.py", line 87, in render
    bandwidth = round(segment.data_size_with_init * 8 / segment.duration * 1.2)
AttributeError: 'Segment' object has no attribute 'data_size_with_init'

stream can’t be loaded in custom_components - if you want to use another version you’ll have to replace the stream folder directly in the HA src folder

1 Like

ah , but thats always the method i use if i want to test PR stuff, if there are only changes in 1 specific integration, its possible to just load as a custom… so if i place the “stream” folder there, the original “stream” will be ignored

i do run HassOS, so for me not possible to overwrite the original folder

I see. That won’t work with stream because it’s also loaded directly from the code base by camera so those versions will clash at runtime.

ah ok, so no way to test if running HassOS?

I’m not familiar with HassOS but I don’t think so :frowning:

thats too bad, well lets hope i dont see the issue again in 2021.10 :slight_smile:

Actually, since it was already merged into dev, you can test it out by switching to dev. See Common Tasks - Operating System - Home Assistant
To set up the LL-HLS options, add the following to your configuration.yaml:

stream:
  ll_hls: true
  part_duration: 0.75
  segment_duration: 6