keshavdv / unifi-cam-proxy

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

Nest camera support #56

Closed Ryamonster10 closed 3 years ago

Ryamonster10 commented 3 years ago

I know what you are going to say, BUT NEST CAMS ARENT RTSP I know, but they are m3u8 hls and you can get the links. But if I put in my nest cam hls m3u8 link, it can’t connect however vlc can do it and blue iris can do it and agent can do it and ffmpeg can do it. I think it is a matter of support that type of input. If you don’t have a nest camera and would like to learn how the links are generated please tell me, we can work together. But in general nest cameras work on the hls m3u8 protacal and there links looks somthing like this: https://stream-eu1-charlie.dropcam.com/nexus_aac/XXXXXX/chunklist_XXXX.m3u8?public=XXXXX

Ryamonster10 commented 3 years ago

I have been able to use an rtsp stream proxy and get it to work but that is more apps and it takes a lot of my CPU power and it would be nice to have this work native

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

greghesp commented 2 years ago

@Ryamonster10 I'm not too familiar with the unifi-cam-proxy, but I do know that the new Nest API supports generating RTSP streams: https://developers.google.com/nest/device-access/traits/device/camera-live-stream#generatertspstream

The only issue is they're valid for 5 minutes at a time, so there would need to be something else running in the background to extend the stream session

Ryamonster10 commented 2 years ago

Yes, there is a little script made for streaming nest cams to YouTube that extends the stream over and over again. However there is an much easier (albeit less secure) method of doing this. If you share your camera publicly (which means with a public facing URL) and then go into that URL and look at the network requests it is sending, you will find a m3u8 link (which I think) you can pipe right into UniFi. If you need a nest camera to use, just let me know.

On Mon, Nov 1, 2021 at 5:12 AM Greg Hesp @.***> wrote:

@Ryamonster10 https://github.com/Ryamonster10 I'm not too familiar with the unifi-cam-proxy, but I do know that the new Nest API supports generating RTSP streams: https://developers.google.com/nest/device-access/traits/device/camera-live-stream#generatertspstream

The only issue is they're valid for 5 minutes at a time, so there would need to be something else running in the background to extend https://developers.google.com/nest/device-access/traits/device/camera-live-stream#extendrtspstream-request-and-response the stream session

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/keshavdv/unifi-cam-proxy/issues/56#issuecomment-956061509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXPDC2BIDX7HQCIKLFEVATUJZKXLANCNFSM5ARBMHWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Ryamonster10 commented 2 years ago

Also, VLC understands the link really nicely.

greghesp commented 2 years ago

I've got several nest cameras, the issue is if rather not make them publicly facing. Do you have the Nest to configure and renew access?

Ryamonster10 commented 2 years ago

They are not "public facing" they just have a URL that is open to the internet. The nice thing about the URL is that it doesn't renew like the nest API does. The nest API could work but the public facing URL option would probably be a lot easier. Here is a converter from public URL to the RTSP URL: https://www.ispyconnect.com/userguide-nest.aspx you can try that, if you are not comfortable with that, maybe we can use the Nest API

On Mon, Nov 1, 2021 at 8:42 PM Greg Hesp @.***> wrote:

I've got several nest cameras, the issue is if rather not make them publicly facing. Do you have the Nest to configure and renew access?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keshavdv/unifi-cam-proxy/issues/56#issuecomment-957002452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXPDC7UCGCSZ3EFQX4XQWLUJ4XV3ANCNFSM5ARBMHWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

greghesp commented 2 years ago

@Ryamonster10 Was there a particular way you got this working?

I think this is a general error, not related to Nest though. Below is what im running, with the values swapped out, but I get the below error

docker run --rm -v "/Users/greg/Desktop/client.pem" keshavdv/unifi-cam-proxy unifi-cam-proxy --verbose --host 192.168.1.1 --cert /client.pem  -n "rtsp" --token <token> rtsp -s "<stream>"

Error

Traceback (most recent call last):
  File "/usr/local/bin/unifi-cam-proxy", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/unifi/main.py", line 106, in main
    cam = klass(args, logger)
  File "/usr/local/lib/python3.7/site-packages/unifi/cams/rtsp.py", line 14, in __init__
    super().__init__(args, logger)
  File "/usr/local/lib/python3.7/site-packages/unifi/cams/base.py", line 48, in __init__
    self._ssl_context.load_cert_chain(args.cert, args.cert)
FileNotFoundError: [Errno 2] No such file or directory
Ryamonster10 commented 2 years ago

I am pretty sure the issue is with docker. I ran mine natively, try spinning up an ubuntu VM on docker (docker run -it ubuntu) and then install it on there. Also check to make sure that 1: the Bugs bunny video works and 2: that you can view the nest camera in VLC

Ryamonster10 commented 2 years ago

Are you still interested in this?