-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please Add ONVIF Support. - UniFi Protect 5.0 now Supports Third Party Camera's. #1355
Comments
The current known bug with unifi is you can't authenticate the onvif it fails even if you have correct credentials apparently they are aware but no fix date is posted yet |
I think still Wyze Docker would not work because it does not output or provide a working onvif protocol? Unless I'm not understanding that. |
I have an old local build with some basic support for ONVIF - auto discovery only works on a linux host as it seems to require the I don't have any ubiquiti gear to test it with, but I can try to clean up some of that code. |
Thank you, I guess I will have to learn to set it up on Linux hehe. I think for me getting away from the costly Blue Iris would be a really nice deal and I already had a UDM Pro already so this is pretty cool. Thanks for looking into it. |
BI's new licensing where if you go out of support they stop recording is pushing me to look elsewhere too although I suspect it'll be something closer to Frigate that Unifi although I run some of their hardware (not their NVR). The Wyze-bridge runs GREAT in a container on Linux! Wish something like this was available for the Ring lights I inherited - grr! |
I pushed a new This is still very basic and doesn't support any auth stuff yet, so you may have to set |
sorry still reading through the code ...did you have a separate port / url that will be used to stream a particular camera ect? |
You should be able to point it to your bridge on port 5000. |
Looking into seeing if its a firewall issue now. Does anyone else out been able to test this too? https://help.ui.com/hc/en-us/articles/26301104828439-Third-Party-Cameras-in-UniFi-Protect Preparing a Third-Party Camera
|
As far as I know mrlr8 said discovery is disabled so Unifi is not going pickup anything till that is added. So I assume, not sure if it's correct, but it should not work on the unifi stuff yet. |
Most of the ONVIF clients that I've been testing have an option to "manually" add a camera. I can enable the WS discovery, but it will require the Edit: latest |
Yeah currently the ubiquity one can only find it via discovery no manual adding yet. But this is their very first iteration so they might add more over time. |
Latest onvif image should have a services:
wyze-bridge:
container_name: wyze-bridge
restart: unless-stopped
image: mrlt8/wyze-bridge:onvif # onvif image
network_mode: host # host mode
environment:
- WS_DISCOVERY=true # enable discovery
.... |
@StoneLegion I've got a Ubiquity UNVR, and you can add cameras manually, though they didn't make it easy to find. See the screenshot below. However, I can't authenticate to the bridge. I tried username of
@mrlt8 I tried reviewing the authentication code for this but nothing stands out to me. Any ideas? |
Wow this is great work and thanks @Nayruden I will have to try this when I have time. Please keep us updated with it. |
Something is up with the authentication code, I believe. Even with authentication disabled
|
I agree. Something with auth if failing. I went to auth = false and turned off network host and then i could log in. I did want to say THANK YOU THANK YOU for your help working this. If it doesn't happen any time soon or at all ..its ok. It's just going to be pretty crazy fun if it does end up working. |
I made some changes to disable validating the authentication headers when Still not sure why authentication is failing when |
which tag? i see three? or should we just pull the code and build the image locally? |
All the onvif related stuff should be in the onvif tag or you can build the image from the onvif branch locally. The latest onvif image should show the |
With
It still fails with "authentication failed" with |
Nope -- doesn't matter what the bitrate is set to. It seems like UNVR will always take the first stream as "high quality" and the second as "low quality". |
Awesome! I've got scrubbing working now. I have def get_profiles(streams):
resp = """<trt:GetProfilesResponse>
"""
resp_high = ""
resp_low = ""
for stream in streams:
bitrate = 200 if "-sub" not in stream else 100
resp_add = f"""<trt:Profiles token="{stream}" fixed="true">
<tt:Name>{stream}</tt:Name>
<tt:VideoSourceConfiguration token="VideoSourceConfig_1">
<tt:SourceToken>VideoSource_1</tt:SourceToken>
<tt:Bounds x="0" y="0" width="1920" height="1080"/>
</tt:VideoSourceConfiguration>
<tt:VideoEncoderConfiguration token="VideoEncoderConfig_1">
<tt:Encoding>H264</tt:Encoding>
<tt:Resolution>
<tt:Width>1920</tt:Width>
<tt:Height>1080</tt:Height>
</tt:Resolution>
<tt:RateControl>
<tt:BitrateLimit>{bitrate}</tt:BitrateLimit>
</tt:RateControl>
</tt:VideoEncoderConfiguration>
</trt:Profiles>
"""
if "-sub" in stream:
resp_low += resp_add
else:
resp_high += resp_add
return resp + resp_high + resp_low + "</trt:GetProfilesResponse>" |
It's been a week since the last reply. Is it running solid and well for yo guys? Worth migrating from Blue Iris to it or is there some stuff that needs to be fixed either UBNT side of things on the Hack? |
I would like to test this, How would i Enable ONVIF in a Portainer config? Or is that not supported? |
It's been working rock-solid for me! I've got four Wyze cameras streaming to UNVR now and they work just like the official Unifi cameras, except there's no motion detection. |
@Nayruden - sorry if this is a dumb question, but where did you put the "Filter_Names" option? Is that in the Docker settings or in the onvif.py file? I am running this on UnRAID, using the pre-built package. Also, I can't find the onvif.py file anywhere to modify. I need to keep looking for that. I have been recording one camera for the last week, but it is bringing in two different streams for that one camera. |
|
@Nayruden I follow the idea of having multiple hostnames pointing to the same IP, but I'm missing how we get wyze-bridge to present the single filtered camera on each host name. Are you running multiple copies of wyze bridge, each filtered to a single camera? |
No, I'm only running one copy. ONVIF is a one-time setup process. ONVIF hands back the RTSP stream URI and the NVR only ever cares about that URI that was handed back going forward. The wyze-bridge hands back RTSP streams that include the name of the camera and it doesn't matter what ONVIF passes to other clients in the future since it only ever grabs the data once. EG, see #1355 (comment) for how it stores the camera data after getting it from ONVIF -- it has the RTSP stream saved and that's all it ever cares about going forward. At least, that's how UNVR works. I'm assuming others would be the same. |
i have 8 cameras...i'm getting ready to use a new PI for all the work. @Nayruden does the onvif image have hardware acceleration in it? |
Unless you're doing something unusual, my understanding is that wyze-bridge does a stream copy (no additional processing with CPU or GPU required). |
wish know how work this , understanding its for cameras with onvif type? i have a few brands, use other method to able to play on synology surveillance, but its possible do on bridge great. understanding need inject onvif.py and how its on the chapgpt chat file with the info about my cameras? thats a python file ? it gives a link address but after you shutdown camera or open app it gives a new address. no fully sure about this exactly but do some like that , no checked again just now it gives something like this , rtsp://192.168.2.208:554/live/1jxxxxxjzaxa_p0_UFDWJJDBIHUE , then change last letters ramdomly |
ok i figure out this lol . i did in the past cant remember before. one above give a different token? on the link , then go2rtc its able to get a permanent link onvif://email:[email protected]:80?subtype=SubProfileToken go2rtc discover camera with some data, and generate this one above, and you use to get m3u8 links there so how i can use any of this for use onvif? i have already running onvif docker with this services: wyze-bridge: but not discovers any camera onvif. |
Hey! Wondering if this has been getting further attention. From what I am seeing I am unable to add multiple cameras using the DNS and filtering. I've also tried multiple instances of the bridge with filtering and protect will only add 1 camera. I think it's recognizing the IP yet I may be wrong. Also wondering if WS_Discovery should be working and if so does it work when the Bridge Host and Cameras are on separate vLans. Thanks :) |
@Nayruden Nayruden I'm wondering if anything has changed in Protect. When I try to add a new camera with a new hostname (but pointing to the same IP:Port, It just updates the first one as if it fully resolves the dns to the IP and sees them as the same device. |
@daxiang28 I'm running the latest version of everything and it's still working great for me. But I haven't added any additional cameras since I first set it all up. It would be odd if the Protect is trying to align devices by IP though, since the major reason of using DNS is so that the underlying IP can change later. |
@Nayruden I was actually just about to post about this when I saw @daxiang28 already had. I've been working on getting this fully up and running since last night and ran into the same issue daxiang did. I was able to use the |
Finally set up a local DNS server to try this technique and am also running into Protect just overwriting the settings of the previous camera when I add a new one with a different hostname. Dumping the system migration data from Protect, in the camera definition JSON we can see a few extra values that the NVR is storing. You can see before and after adding a new camera it keeps the MAC address the same and also an 'ID' field down by the RTSP stream locations. My guess is it's clobbering the old camera based on matching mac address.
|
My EDIT: Just to give more information... UNVR is at |
@Nayruden Perhaps export your NVR settings via Settings->System->Migration->Download File and look at the cameras.json file to see if it's missing a MAC header? Also to see if the "id" field at the end of each camera definition is different. |
@MNewman is Snippets of two cameras below... {
"mac": "A6294009C422",
"host": "cam1.wyze.my.house",
"connectionHost": null,
"type": "Wyze Bridge onvif Build [X86_64]",
"name": "cam1"
} {
"mac": "86171EC071C3",
"host": "cam2.wyze.my.house",
"connectionHost": null,
"type": "Wyze Bridge onvif Build [X86_64]",
"name": "cam2"
} I double checked the neighbor list on the UNVR and confirmed that for me at least, the MACs listed above do not map to any device known by the UNVR. |
Indeed that is the actual MAC of the IP hosting the wyze-bridge. Can Docker
be configured to run the bridge on a separate virtual nic that obfuscates
the mac address? Or would that be more a function of the actual network
configuration? At present it's flat, no vlans, single subnet.
…On Wed, Dec 11, 2024 at 8:02 AM Brett Smith ***@***.***> wrote:
@MNewman <https://github.com/MNewman> is 90B11C8BC575 the actual MAC of
the IP serving up your Wyze Bridge? For me, they're just random values, but
they are unique for each camera...
Snippets of two cameras below...
{
"mac": "A6294009C422",
"host": "cam1.wyze.my.house",
"connectionHost": null,
"type": "Wyze Bridge onvif Build [X86_64]",
"name": "cam1"
}
{
"mac": "86171EC071C3",
"host": "cam2.wyze.my.house",
"connectionHost": null,
"type": "Wyze Bridge onvif Build [X86_64]",
"name": "cam2"
}
—
Reply to this email directly, view it on GitHub
<#1355 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIIXR3VRBQ73JTZCXET4ET2FAZU7AVCNFSM6AAAAABOKQQ6DCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZVHEZTAOBTHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
If your network equipment supports VLANs, you can attach a docker container to a different VLAN by creating a sub-interface and then attaching the container to that interface (not as hard as it sounds as long as your network equipment supports VLAN tagging). You could also try changing the MAC on your Docker machine's physical interface after you add each camera -- that would work as long as the UNVR never verifies existing MACs again. |
I just tried your VLAN method (created new VLAN, tagged the container to route traffic through it and left the rest of the server alone on the main network) and still ran into the same issue since the MAC address showing for the cams is still the real physical address of the server that the container is running on. Did I misconfigure something on the VLAN in the Unifi console so that it's not obfuscating the MAC address? |
Any chance of having this awesome branch merged into main? I cannot wait to use this from homeassistant addon setup. Otherwise, any possible way to fetch this branch instead of main when using homeassistant addon? |
Stumbled on this but have yet to try it. Anybody try this with Protect? |
I tried configuring the onvif build with Frigate for PTZ control and auto tracking. Looks like the current onvif build does not list PTZ configuration. I know we already have access to set a custom value for the camera Pan and tilt function using mqtt or rest api. Is this something that is being considered. If not I'll try adding in the config in my local build and try setting up basic Pan tilt config. |
I was able to get this to work on my Synology (via their native Container Manager app) using a Docker compose. The trick was the macvlan. Additionally, I did setup a custom DNS on my network for each camera that routed back to the IP address that was set with the
|
@daxiang28 I installed Thingino on a Wyze v2. I think there is a bug in protect that causes the camera to go offline every 10 seconds. The RTSP stream was stable though. |
Using this on a Virtualbox Ubuntu VM. What credentials are you using to sign in via onvif? I am using Unifi protect. I have not had to create a DNS entry yet, could you please provide an example of what you added for a DNS entry? When I use your macvlan method, I get onvif discovery popup on the unifi protect and a log saying [ONVIF] WS-Discovery enabled for 192.168.5.251:5000, however, I am unable to log in to the web interface. However, when I set network mode as host, I can log into the web interface, but onvif discovery disappears and shows in the logs as "[ONVIF] WS-Discovery enabled for 127.0.1.1:5000" Update: I was able to get this working for 1 camera. I did NOT create a DNS entry. I cannot figure out how to get this working for 2. The ports conflict for 127.0.1.1:5000 when trying to run multiple containers, I don't know where to change the port for that address or where wyze_bridge is pulling that IP from. Perhaps use a IPvLAN instead of a macvlan? What was your reason one way or another?
This is the config I used to get 1 Wyze Pan v3 working in Unifi Protect over ONVIF. I have another VM running docker on Hyper-V running this for another Pan v3. Any chance for audio support support over ONVIF?
|
Describe the bug
I'm wondering if anyone able to get it to work? It says any camera that uses ONVIF Support, not sure if we emulate or can emulate such a feature?
I have a Dream Machine Pro, and tbh I love to get away from Blue Iris.
Affected Bridge Version
0.0
Bridge type
Docker Run/Compose
Affected Camera(s)
No response
Affected Camera Firmware
No response
docker-compose or config (if applicable)
No response
The text was updated successfully, but these errors were encountered: