keshavdv / unifi-cam-proxy

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

Reolink Problem #24

Closed andreaconfa closed 3 years ago

andreaconfa commented 3 years ago

Hi all, i'm tring to make the proxy work with reolink cameras (direct connection) or via the NVR.

If i connect via the standard rstp protocol the stream remains black. The rstp link is ok and working in VLC: rtsp://admin:password@ip_address:554//h264Preview_01_main

If i use the reolink_nvr option i'm able to get an image but it still freezed to the first frame....

any suggestion?

JakeShirley commented 3 years ago

@andreaconfa is it the same via the Protect mobile app? I've seen this behavior via the web browser.

You can also try just the generic RTSP stream option (instead of Reolink) to see if the video improves. If so I probably have a bug in the Reolink stuff.

andreaconfa commented 3 years ago

If I use the protect app, it crash immediately after displaying the streaming

Inviato da iPhone

Il giorno 1 mag 2021, alle ore 18:07, Jake Shirley @.***> ha scritto:



@andreaconfahttps://github.com/andreaconfa is it the same via the Protect mobile app? I've seen this behavior via the web browser.

You can also try just the generic RSTP stream option (instead of Reolink) to see if the video improves. If so I probably have a bug in the Reolink stuff.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/keshavdv/unifi-cam-proxy/issues/24#issuecomment-830655266, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKUNNLKAIWFGVBUHBJV5MX3TLQRN3ANCNFSM435NVEKA.

JakeShirley commented 3 years ago

Very odd! I noticed the RTSP stream link you posted is direct to the camera, can you try the RTSP stream from the NVR in VLC? It should be in this format: rtsp://{username}:{password}@{ip}:554//h264Preview_{channel}_main

Note: Channel here starts at one and not zero.

andreaconfa commented 3 years ago

I test it now and I let you know

Inviato da iPhone

Il giorno 1 mag 2021, alle ore 19:56, Jake Shirley @.***> ha scritto:



Very odd! I noticed the RTSP stream link you posted is direct to the camera, can you try the RTSP stream from the NVR in VLC? It should be in this format: rtsp://{username}:{password}@{ip}:554//h264Preview_{channel}_main

Note: Channel here starts at one and not zero.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/keshavdv/unifi-cam-proxy/issues/24#issuecomment-830669678, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKUNNLI64T4G2O4JUCLLJEDTLQ6E3ANCNFSM435NVEKA.

andreaconfa commented 3 years ago

Very odd! I noticed the RTSP stream link you posted is direct to the camera, can you try the RTSP stream from the NVR in VLC? It should be in this format: rtsp://{username}:{password}@{ip}:554//h264Preview_{channel}_main

Note: Channel here starts at one and not zero.

With this the streaming keep loading (not even preview)

Command used: unifi-cam-proxy --host 192.168.1.1 --cert client.pem --token XXXXXXXXX rtsp --source rtsp://user:pass123@192.168.3.2:554//h264Preview_0_main

image

image

JakeShirley commented 3 years ago

Very odd. Normally I get at least screenshots. Video doesn't normally play in-browser for me, but it sometimes does in the mobile app.

andreaconfa commented 3 years ago

Very odd. Normally I get at least screenshots. Video doesn't normally play in-browser for me, but it sometimes does in the mobile app.

i think that i have to abandon the idea to port my reolink camera on the udm, however i'm available if there will be available some updates to this issue

keshavdv commented 3 years ago

Can you share the output of ffprobe rtsp://admin:password@ip_address:554//h264Preview_01_main run from a machine that has ffmpeg installed?

andreaconfa commented 3 years ago

Here the output

image

Can you share the output of ffprobe rtsp://admin:password@ip_address:554//h264Preview_01_main run from a machine that has ffmpeg installed?

keshavdv commented 3 years ago

Can you try running the following?

unifi-cam-proxy --host 192.168.1.1 --cert client.pem --token XXXXXXXXX rtsp --source rtsp://test123:test123@192.168.3.11:554/h264Preview_01_main

The RTSP source in your screenshots seems to vary, but at least the one used in the ffprobe command sounds like it should work.

andreaconfa commented 3 years ago

Can you try running the following?

unifi-cam-proxy --host 192.168.1.1 --cert client.pem --token XXXXXXXXX rtsp --source rtsp://test123:test123@192.168.3.11:554/h264Preview_01_main

The RTSP source in your screenshots seems to vary, but at least the one used in the ffprobe command sounds like it should work.

Streaming stay black Via VLC player the rstp link work correctly.

image

image

keshavdv commented 3 years ago

Some recent refactoring broke the snapshots when using RTSP that was fixed in 16c025ea35. Can you install the latest version and try again?

andreaconfa commented 3 years ago

Some recent refactoring broke the snapshots when using RTSP that was fixed in 16c025e. Can you install the latest version and try again?

ok thankyou. now the snapshot is loaded correctly but the stream doesn't load. it still on loading image

keshavdv commented 3 years ago

Can you test from an external network or LTE on your phone? Some people have reported issues in specific networks

andreaconfa commented 3 years ago

Can you test from an external network or LTE on your phone? Some people have reported issues in specific networks

tested... same issue. I see the "snapshot" but not the actual video streaming

JakeShirley commented 3 years ago

@keshavdv @andreaconfa I just updated and tested locally with my Reolink cameras. 2/3 cameras on the NVR snapshot just fine (and I can post the URL into my browser and it will return an image).

The third camera refuses. It loads for about 5 seconds then returns:

[ { "cmd" : "Snap", "code" : 1, "error" : { "detail" : "get config failed", "rspCode" : -12 } } ]

I've also noticed that it's motion API occasionally craps out. The camera will then restart (and lose connection to the NVR).

I have a few stability fixes to submit for the Reolink NVR cam but I'm chalking this up to Reolink having shit firmware.

Side note: I called the capabilities endpoint for all three cameras (http://<IP>/cgi-bin/api.cgi?cmd=GetAbility&user=<USER>&password=<PASSWORD>&rs=<RANDOMCHARS>&channel=<CHANNEL>) and all three look the same for snapshotting. I might try updating the firmware for the flaky camera.

andreaconfa commented 3 years ago

All my cameras is updated with the last firmware available , the new one with HTML5 player instead of flash

Inviato da iPhone

Il giorno 5 mag 2021, alle ore 18:13, Jake Shirley @.***> ha scritto:



@keshavdvhttps://github.com/keshavdv @andreaconfahttps://github.com/andreaconfa I just updated and tested locally with my Reolink cameras. 2/3 cameras on the NVR snapshot just fine (and I can post the URL into my browser and it will return an image).

The third camera refuses. It loads for about 5 seconds then returns:

[ { "cmd" : "Snap", "code" : 1, "error" : { "detail" : "get config failed", "rspCode" : -12 } } ]

I've also noticed that it's motion API occasionally craps out. The camera will then restart (and lose connection to the NVR).

I have a few stability fixes to submit for the Reolink NVR cam but I'm chalking this up to Reolink having shit firmware.

Side note: I called the capabilities endpoint for all three cameras (http:///cgi-bin/api.cgi?cmd=GetAbility&user=&password=&rs=&channel=) and all three look the same for snapshotting. I might try updating the firmware for the flaky camera.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/keshavdv/unifi-cam-proxy/issues/24#issuecomment-832822130, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKUNNLMV5JSGX4VCYDMHPV3TMFVCHANCNFSM435NVEKA.

keshavdv commented 3 years ago

Can you follow the steps on https://support.reolink.com/hc/en-us/articles/360007010693--How-to-Set-H-264-Profile-to-Baseline for your camera and try again?

nxtByte commented 3 years ago

Hey @andreaconfa! If you really need to get your cameras to work right now, I found a "workaround". Note, that this workaround uses quite some CPU/GPU horsepower, because of the re-encoding taking process. However, if you have powerful enough hardware, you could give it a try. See here: https://github.com/keshavdv/unifi-cam-proxy/issues/31#issuecomment-841831943

keshavdv commented 3 years ago

Please try the instructions at https://github.com/keshavdv/unifi-cam-proxy#reolink and create a new issue if it's still a problem.

andreaconfa commented 3 years ago

i'm testing it again but always same issue

Please try the instructions at https://github.com/keshavdv/unifi-cam-proxy#reolink and create a new issue if it's still a problem.