Unifi Camera Update! (Fix Available for Testing Now)
UNIFI CAMERA UPDATE
FIX AVAILABLE IN MONOCLE GATEWAY v0.0.6
see this post below: https://forum.monoclecam.com/topic/1242/unifi-camera-update-fix-available-for-testing-now/14?_=1659280156800
I have received my new Unifi cameras and have successfully installed them in Protect via the UDM-PRO.
Those users that identified the secondary audio stream were dead on with the issue. Apparently the Amazon devices don’t like seeing this secondary audio channel even when we explicitly tell Alexa to use the AAC audio codec. Removing this secondary audio channel (codec:
opus) does allow the Unifi camera’s to once again work with the Amazon devices. I would contend that this is more of an Amazon issue rather than a Unifi issue. A streaming endpoint should be able to see multiple audio and video streams/channels in the descriptor and choose which one is best for the rendering the feed for that device.
@noaudiotag should have addressed this issue; however, I found a bug in the Monocle Gateway where it’s only removing the first audio feed in the descriptor. (Modifying the content elements of an array while you are iterating over it is a no-no … whoops.)
I will be adding some method to allow users to choose the audio channel or some method to filter out unwanted channels. This way your Unifi cameras will still be able to work while retaining audio.
Lastly, regarding the “RTSPS” protocol. I will be making changes to support the TLS (secure) connections to “
Hoping to get a new version out for testing next week!
Thanks again for your efforts on this, happy to help if needed.
@Monocle thanks for the update. Still got my container in unraid so can spin it up quickly and test it again when updated.
@Monocle That’s great news, thanks! And I totally agree, Amazon devices should not be so rigid.
happy dance :-) Thank you Robert
Robert this is great news! Thank you very much for your continued support of this project. My family and I used to rely on this integration multiple times a day and it will be great to get it back to working status. I’d be happy to do some testing if needed.
@Monocle That’s fantastic - many thanks Robert!
Thanks Robert! I have a couple Unifi Cameras in protect and since Protect 2.01, things broke as you know. I want to publish an update to my YouTube Video when you get the fix. --Scott
Robert, Thank you very much for the effort and work. I’ve been missing my gateway. Essentially making my Shows useless. W/O the gateway, might was well have a dot or what ever they are called now a days.
Great Thanks! Any news so far?
hope to See it soon
Monocle last edited by
Just an update …
I have updated the codebase for Monocle Gateway and now have it working for RTSP and RTSPS.
Using the tag
@fixaudiowill both remove the “opus” encoded audio stream in the stream descriptor. (which makes Alexa/Echo devices happy)
I will probably auto-assign the
@fixaudiobehind the scene for cameras labeled with the manufacturer “Unifi” or “Ubiquity”. We currently do this for “Foscam” cameras for a separate compatibility issue.
No releases to test with yet. I need to update the portal web UI and create new builds. Hopefully tomorrow.
Awesome Robert. Tag up with me if you want me to test.
I have run into some build issues and have to rework some of the continuous integration workflow. So that is delaying some of the work to get this update more polished and released. However, I do have test builds available if anyone wants to test them. These are currently untested/unverified builds but feel free to play with it and report back if it’s working for you.
Download Test Builds Here:
Monocle Gateway (v0.0.6)
Make sure to use the tag
@fixaudiowith your Unifi camera in addition to the
The need for this tag may be removed in a final release.
@insecuretag below if you are using RTSPS encrypted connections.)
Unifi Camera RTSP URLs
Note both RTSP and RTSPS (TLS) are supported.
Unifi URL Examples Examples:
Please note that the default RTSPS URL provided by your Unifi camera includes an “?enableSrtp” parameter at the end of the URL. (Example:
rtsps://10.1.1.1:7441/Aqf2cTyOvd96zDde?enableSrtp) You will need to omit this parameter for use with Monocle Gateway. This parameter enables Secure-RTP (SRTP) protocol inside the TLS encrypted stream — unfortunately Alexa/Echo devices don’t know how to handle the SRTP protocol and Monocle Gateway does not touch the stream packets, it only passes them across the tunneled connection.
Also note that the Monocle Web Portal will display an error if you use the “RTSPS” prefix in the RTPS URL. Just ignore the error and continue, it will still save the RTSPS URL you entered.
Self Signed Certificates
For RTSPS URLs, these are using a secure connection via TLS. Secure connections expect a valid SSL certificate to fully validate the encrypted connection. However, if you are just using the Unifi camera out of the box, it will only provide a self-signed certificate. You will need to also include the
@insecuretag to tell the Monocle Gateway to accept self-signed or non-validated certificates. It will still use an encrypted TLS connection but it won’t enforce validation on the certificate.
Multiple Monocle Gateway Instances
You may not be aware, but you can run multiple Monocle Gateway instances simultaneously!
Each instance does need a separate/unique authentication token. The last one to come online takes the “master” role and services all camera requests. If the current “master” falls offline, then one of the other connected gateway’s is promoted to the “master” role. This concept allows for failover but you can also test a new version of Monocle Gateway in a new instance without touching your existing working version of the gateway.
Just thought I would throw that out there for anymore wanting to test this new version …
Thanks so much for the update. I can confirm it works with rtsp/rtsps on my echo show 10 (2nd gen). (Using tags: tunnel,fixaudio,insecure)
Unfortunately, whilst the fixaudio tag seems to work, the noaudio tag does not. This is my preferred setup as I don’t like the echo to make noise.
I just tested it here on my Unifi G4 Pro using both RTSP and RTSPS and
@noaudiois working here.
(Running on Linux-x64 and OSX-x64.)
You should see a section in the log with “[CLIENT RESPONSE] <-- [BODY]” followed by the SDP (stream descriptor) information. Post what yours shows and lets see if the opus audio is still present.
Here is an example of mine … using
2022-07-30T14:15:57.930Z [TRACE] [172.17.0.1:58208 <qRO0EG-76>] [CLIENT RESPONSE] <-- [BODY] v=0 o=- 146 0 IN IP4 10.1.1.1 s=D021F9925C56_0 u=www.evostream.com c=IN IP4 10.1.1.1 t=0 0 a=control:* a=recvonly a=range:npt=now- m=video 0 RTP/AVP 97 a=rtpmap:97 H264/90000 a=fmtp:97 profile-level-id=4d4033; packetization-mode=1; sprop-parameter-sets=Z01AM42NQB4AIf/gLcBAQFAAAD6AAAu4CdoIhGo=,aO44gA== a=control:trackID=2 a=recvonly
i ´ve updated my System Linux-x64 and try with @noaudio or @fixaudio
but always camera is´nt responding…Echo Show8
Start Server again , same thing…
I upgraded too with my Unifi Cams and it work very well with the last Protect update (2.1.2)!
I used @tunnel an @fixaudio
I use a UDMPRO and 3x G3Pro and 1xG4 Doorbell
And I use 3x Echo Show 5 and 8
ok, my fault…
need to set " , " between the tags…did´nt know
Ok I used one character distance between