Batch generation of camera snapshots

Solved
marcus_kisi
Here to help

Batch generation of camera snapshots

Hi, i'm currently trying to generate some camera snapshots with the API call https://developer.cisco.com/meraki/api-v1/generate-device-camera-snapshot/. However, I'm running into rate-limiting issues with this method. I will create a burst of 3-9 snapshots per event I am trying to get the snapshots of, but this is inefficient and is leading to long queues of waiting to try to circumvent the rate limit Cisco has on its API calls, especially with exponential backoff, and also does not leave much room for any other API calls to go through.

 

Trying to retrieve the link for when there is heavy load, also leads to a similar issue to this case: https://community.meraki.com/t5/Developers-APIs/None-of-the-snapshot-link-works-return-for-camera-ty... where I will receive an ERR_INVALID_RESPONSE error in the webpage, requiring 1-2 mins to load.

 

Has anyone successfully figured out a more efficient way to go about doing this? Thanks!

1 Accepted Solution
Greenberet
Head in the Cloud

There are probably two solutions for your problem depending on your environment:

1) you could postpone the generation and just provide the timestamp for the event.

2) if you are in the same network as your camera(s) you could enable rtsp and get the images from the life feed

2b) you could also use a third party application for that which generates images from rtsp and deletes everything older than X hours/days/... (depending on your storage). If the event occurs, you can copy the required images directly from the file system

View solution in original post

4 Replies 4
Greenberet
Head in the Cloud

There are probably two solutions for your problem depending on your environment:

1) you could postpone the generation and just provide the timestamp for the event.

2) if you are in the same network as your camera(s) you could enable rtsp and get the images from the life feed

2b) you could also use a third party application for that which generates images from rtsp and deletes everything older than X hours/days/... (depending on your storage). If the event occurs, you can copy the required images directly from the file system

marcus_kisi
Here to help

I don't have access to the network currently, so this wouldn't be viable, but I will look to see if that is possible. Thanks for the suggestion!

PhilipDAth
Kind of a big deal
Kind of a big deal

What I did - add your snapshot requests to a queue.  Have something servicing the queue to make the API requests.  When a request fails defer it for 30s, and do 5 retries.

marcus_kisi
Here to help

I've done this already, but I think for the volume of traffic that the camera is experiencing, my queue still gets very backlogged. I don't think this would be solvable with the API right now with its rate limits, and no way to batch retrieve snapshots. But thanks for the suggestion regardless!

Get notified when there are additional replies to this discussion.