- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
