keshavdv / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
1.69k stars 236 forks source link

Wyze rtsp + protect kills mobile app #28

Closed jstevewhite closed 3 years ago

jstevewhite commented 3 years ago

Everything went swimmingly and the Wyze V2 cam works perfectly in the web (slow, but expected).

When I open the mobile Protect app, I can see both my ubiquiti cam and my wyze cam, but when I open the wyze cam, the app dies. Then it continues to die until I unplug the camera, start the app, and go back to the monitor screen that shows all the cameras.

Thoughts? Any logs that might help?

keshavdv commented 3 years ago

I think there have been reports of Wyze cams working fine, so I'm not sure what's going on here. Given the app crashes are something we won't have any visibility into, I'm not sure there's much we can do. Have you tried other RTSP sources and had similar issues?

hhinma commented 3 years ago

This may or may not be related. After playing around for an afternoon, I have a stream appearing the web UI and in the main screen on the mobile app. This stream is from the test rabbit movie, since I seem to have a problem with timeouts trying to use the camera I am testing (still working on that).

If I select the new feed in the mobile app, the app crashes. Attempting to open it causes it to crash also since it returns to attempting to display the new feed.

If I get in quickly enough on the "back" arrow to return to the main screen in the app, it resumes to working fine. At this point, I get the "add new device" popup again, despite the new "device" already being in the main page.

Access via the web seems fine. This looks like a protect app error handing but compounded by some subtlety in the interactions with unifi-cam-proxy. As a side note, I was managing to completely crash the main protect app on the UDMP yesterday while I was trying to setup the stream. That would appear to be a gaping security hole that could be used to disable recording.

I will see if i can collect anything useful from the console/debug on the phone, but may have to chalk this up to "it doesn't work on the mobile app".

EDIT:

The console on the (iPhone) app shows that crashes appear to relate to trying to apply mutually incompatible display constraints - its difficult to tell without the source code.

What pixel aspect ratio was your Wyze camera supplying? Just a random theory here that the app might be getting confused by whatever fake camera model you specified and the display resolution of the feed you are supplying. I don't have a functioning camera at the moment, so can't test that.

Ryamonster10 commented 3 years ago

My nest cam works as well, on the web ui but on mobile it crashes.

Ryamonster10 commented 3 years ago

Just like your waze cam

keshavdv commented 3 years ago

@Ryamonster10, can you try code from the latest main branch? The most recent commit forces mono audio which solved the crashing issue on a particular camera for me, but I'd like to know if that is also the fix for all similar issues.

Ryamonster10 commented 3 years ago

So should I build from sorce code? and if so how?

saschawerner commented 3 years ago

You can override the "AC 1" manually like this

.local/bin/unifi-cam-proxy --host 192.168.1.1 --cert client.pem --token XXXX rtsp -s rtsp://192.168.1.XXX --ffmpeg-args '-c:v copy -vbsf "h264_metadata=tick_rate=25" -ar 32000 - ac1 -codec:a aac -b:a 32k'

saschawerner commented 3 years ago

@Ryamonster10, can you try code from the latest main branch? The most recent commit forces mono audio which solved the crashing issue on a particular camera for me, but I'd like to know if that is also the fix for all similar issues.

This has resolved the IOS / TVOS App crashing on live and recording for me (generic RTSP camera)

keshavdv commented 3 years ago

I published the fix in the latest version so please try a docker pull or pip install --upgrade depending on which mechanism you're using to run the proxy.