Why does it take 9 seconds to get a camera snapshot?

I have an ultrasonic rangefinder I’m using as a trigger to take a snapshot from my camera send it to my phone. It all works but once triggered, it takes 9 seconds to get the snapshot. It is an Amcrest camera and I’m using the Generic Camera integration. Any ideas of how I can speed that up?

Curtis

Buy more powerful hardware :slight_smile:

But tell us more, like the server hardware, camera make etc and someone may be able to offer advice

I’m running my Home Assistant on a Mini PC, Intel Alder Lake N100, 3.6GHz,16GB DDR4, 512G, W11. I have a Google Coral TPU module installed.

I’m using Frigate but I don’t think that is in play for this 9 second delay problem. I could be wrong.

The camera is an Amcrest 5MP Turret POE camera ethernet hard wired. There is a Gigabit PoE Switch between the camera and the HA PC. It’s on the same subnet.

Curtis

Why not just use the frigate blueprint.

Realistically, you need to figure out which part is actually running slowly. For example, you have to set certain options on the notification to ensure it is delivered with high priority otherwise it will wait. You also need to check the i-frame interval of the camera since a snapshot can only be taken on an i-frame

@crzynik.

I tried adding “critical: true” to the notification but I get an error when the automation triggers that says it does not like the “critical” key. Are there other options I should set? I don’t think the notification is the problem because the 9 seconds is from when the snapshot starts to when the notification begins as shown in the Trace Timeline above.

The I-Frame rate on the camera Main Channel is 60Hz. The I-Frame rate on the Sub Channel is 4Hz.

Curtis

There is a delay

Camera >> frigate

Frigate >> HA

Snapshot automation>>HA >>image capture

If you want HA to capture image on camera based on sensor I would go direct HA>> Amcrest to get image. Amcrest has API

If not that, frigate allows output image based on time. You case use the time of trigger event to generate image. You can adjust this time + or minus based on delay of trigger action in HA to actual event.

@Arh,

I have so much grief when I try to use Blueprints. I followed the link you gave and tried to upload it. When I click on the “IMPORT BLUEPRINT TO…” link I get a “The provided URL is invalid” error. I tried a few other ways to import the Blueprint but could not figure it out.

I found another Blueprint “Figate AI Notification” and created an automation based on this. I get an error when I run that automation. I’m trying to figure that out.

I find Blueprints really hard to understand when there are issues.

Curtis

@tmjpugh,

Oh my! There is so much about HA I don’t understand. I thought my action to take a snapshot on “cam_entry_out” was on that entity. Entity “cam_entry_out” is of type Generic Camera. I set it up even before I installed Frigate. Are you saying that the processing goes through Frigate before the snapshot is acquired?

Curtis

I switch from the Generic Camera integration to the Amcrest integration. Now the delay is 2 seconds and sometimes 1 second. This works well for me.

Curtis

If you cant load blueprints it will be due to the link circled in this pic not pointing at your ha server. Edit so its correct.

But using resources to process the same camera twice is going to slow something down surely, now you have yet another app dealing with the camera. Frigate can and will use a lot of resources.

Try it also on frigate camera entity then to be sure . Frigate helps unloading the camera, so if you connect directly to cam again, camera is double queried.
Make snapshot in the frigate entity and you might have even shorter processing time.( Not guaranteed btw)

@Arh,

It opens up HA when I click the link so I don’t think the problem was with not finding my instance.

I agree that Frigate is probably having an impact. I had Frigate, the original Generic Camera, and now the Amcrest integration hooked in. With those three I now see 2 second delay with the Amcrest hook. Both Generic Camera and Frigate are accessing via RTSP so maybe that was the bottleneck. I’m not sure about what Amcrest integration is using (probably RTSP). I now have all the Generic Camera stuff deleted for my five cameras.

Curtis

@checking12,

I don’t see anything like a camera entity available for Frigate that will allow me to do a “Take a snapshot from a camera” action in my automation.

Curtis

You are using frigate wrong. Frigate will detect motion create a snapshot. This can the be the trigger for your automation. This is what that blueprint does, it will forward your snapshot to where ever you want it.

If you really can’t load that blueprint something is wrong. Have you checked it’s not in the create an automation list.

You could trigger the automation on frigate detection and the send the latest snapshot. I hyav8e never tried this so no idea if it will work

2 Likes

what entities you have now on a frigate device in HA?

this is an camera entity:
image
That one can snapshot too. But like Arh says, you can do so much with frigate, thats also something to explore.

@checking12,

I think I must have Frigate installed in a weird way. When I go to the “System>Devices” tab I see two entries for Frigate. Neither have anything like the info you show. Here is the first entry:

Curtis

@checking12,

I figured out my Frigate problem and why I did not see any Frigate entities. I had downloaded the “HACS Frigate Integration” but did not finish or properly configure it. I now see a bunch of stuff similar to what you posted.

Thank you very much for pointing me in the right direction. (Also @arnhag47)

I bet the Blueprint will probably work now too.

Curtis

1 Like

Sometimes a picture says more then whole thread :sunglasses: