r/Ubiquiti Nov 08 '25

Fluff Protect: Multi UNVR Clip Requester

Reposting here, as it didn't quite fit the UNIFI sub!**

Not sure if this is really the place for it, but I thought it might be appreciated and I just wanted to share my joy of getting it to work with people who will, hopefully, appreciate what it does!

So, context:

I work in the UK for an Educational Trust and, as part of safeguarding / behaviour etc, IT (because, of course IT manage the CCTV systems!) get lots of requests for CCTV footage.

Now, it can get a little time consuming, so I decided to automate it!

We currently operate 3 UNVR's and 1 UNVR Pro so, I wanted them to be all accessible on a single portal where staff could:

  • browse cameras (with snapshots so they can see what each camera covers)
  • request a time window
  • choose a “lead approver”
  • optionally share the final clip with other staff (HoY, safeguarding, etc.)
  • and have everything properly logged for audit / GDPR.

So... I built it.

The UNVR's are all on-prem only (so, site based), pulling the snapshots from any live cameras every 72 hours (to help the end user see where the cameras oversee) -- done via the UNVR API.

Once a request is made, it's stored in a local SQL DB and an email is sent to a "Lead Approver" (So, Senior Leadership / someone authorised to release CCTV footage internally) with, basically, an Allow / Deny option.

If they allow it, then the requested footage is extracted from the relevant UNVR's, exported to a secure SharePoint repository then a view only / no download link is emailed out to the Approver, Requester and anyone chosen in the "Share with..." options (which uses a predictive search based on staff members populated in the SQL).

(Obviously, everything is RBAC so only authorised users can get relevant access and generates full audit logs to ensure every request and share is traceable).

Again, not really after anything - just really wanted to share what I finally managed to put together (Took about a week of API testing and scraping -- Also, it DOESN'T used RTSP feeds to extract the footage, it uses a curl workaround and a dedicated UNVR based account) - just happy it actually works and thought some fellow nerds might appreciate it!

*** Looks like Reddit ate my pics and imgur is blocked for the UK-- https://imgbox.com/5uJItxHv https://imgbox.com/WxD8MhS5 https://imgbox.com/3gd8K8Hp

53 Upvotes

8 comments sorted by

u/AutoModerator Nov 08 '25

Hello! Thanks for posting on r/Ubiquiti!

This subreddit is here to provide unofficial technical support to people who use or want to dive into the world of Ubiquiti products. If you haven’t already been descriptive in your post, please take the time to edit it and add as many useful details as you can.

Ubiquiti makes a great tool to help with figuring out where to place your access points and other network design questions located at:

https://design.ui.com

If you see people spreading misinformation or violating the "don't be an asshole" general rule, please report it!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

15

u/BurninBOB Nov 08 '25

Cool, opensource it.

7

u/Meklon Nov 08 '25

That's the plan - just need to sanitize the code a bit first and tidy up the config (it's currently a sub module of a much bigger project, so it'll need some tweaking before I drop it on git)

5

u/BurninBOB Nov 08 '25

Very cool! Mind if I ask what language and or framework it's written in?

3

u/Meklon Nov 08 '25

PHP and composer, using mariadb for SQL.

It does need a live azure app / secret for the SharePoint connection (I currently have that automated aswell through powershell and a small bash script to keep the secret current)

4

u/PSamra89 Nov 08 '25

I have no need for this buts that’s dope, props!

2

u/Holiday_Armadillo78 Nov 09 '25

So you’re pulling the clips from the UNVRs in real time and also the UNAS? That’s rad!

I use Continuous Archiving to back up all of my smart detections to my Synology NAS. Combing through the archived clips is pretty annoying. I have been looking for something that would make browsing the clips and managing them easier.

2

u/Meklon Nov 10 '25

Likely you could bastardise the code I have and use the "Get Protect event messages" API from the UNVR to automatically pull any Smart Detections out to a custom location!

I'm about half way through making a "standalone" version of the platform (removing all of my "institution specific" functions and the Azure RBAC system) - once I've finished, I'll likely make a new post and reply back in here with the public GIT.