EliasKotlyar / Xiaomi-Dafang-Hacks

4.18k stars 1k forks source link

Implement ONVIF support #78

Closed Cr4z33 closed 5 years ago

Cr4z33 commented 6 years ago

Hi,

@EliasKotlyar before I am going to buy this camera can you please tell me if your hack supports ONVIF too?

I am already using some hacked Xiaomi XiaoFang cameras with Synology Surveillance System and I would like to use the Dafang too. :)

shinebar1001 commented 6 years ago

Albeit ONVIF support would be very cool it isn't implemented. But you don't need ONVIF to use the camera with Surveillance Station. Just select the user defined camera with h264, Port 8554 use /unicast as path and leave user + pass empty.

image

Cr4z33 commented 6 years ago

Sweet thanks @shinebar1001 ! 👍

benjR commented 6 years ago

Very useful, should be in the documentation ;-) Is there a way to enable PTZ as well ?

LiloBzH commented 6 years ago

+1 No PTZ with S Station. Maybe it's impossible ? @EliasKotlyar ?

Thanks :)

shinebar1001 commented 6 years ago

I added the configuration to the wiki (trying to copy & paste some ideas from the issues there) Concerning PTZ for Synology Surveillance Station: it seems that you can edit the configuration file for cameras in the Synology. Unfortunately I don't see how to define different ports for commands and the port for the tcp-stream.

LiloBzH commented 6 years ago

yep

PTZ work with ONVIF, not with stream so why ONVIF don't work ? ^^

heyggu commented 6 years ago

I tried this way on my DSM ,but stream is very slow to use, any solution?

rzepa10 commented 6 years ago

@shinebar1001 Hi, did you try xiaomi defang with Surveillance Station. For me RTSP stream is laggy and veeeery slow like @heyggu In VLC everything is ok. Any solution ?

shinebar1001 commented 6 years ago

Actually Surveillance Station is always extremely slow at my place, because I own a DS115J which has only Little RAM + CPU - fine as NAS, no more no less. So I never had any camera connected in real use cases. My solution for that is switching to MotionEye on a local HyperV, which runs smoothly (doesn't help you, I know...)

rzepa10 commented 6 years ago

@shinebar1001 I have DS918+ so cpu power should not be a problem :) For that moment I use mihome app but surveillance station would be much safer in term that my records don't "fly" to china for free :)

mitchoklemen commented 6 years ago

Is there something "new" about PTZ in synology? It would be nice to roll the view around. On DS214play surveillance works just fine. No lags with 4 cameras.

JonyBCN commented 6 years ago

+1 No PTZ and NO SOUND with S Station.

gabcac commented 6 years ago

+1, ONVIF support would have been great for this device. Can this be considered as new request?

For those who doesn't have audio, I suggest them to upgrade to the latest version, and test this post

snjoetw commented 6 years ago

+1 for ONVIF support

fwiw, I finally got audio to work on my hikvision NVR, I had to change encoding to PCM

EliasKotlyar commented 6 years ago

Hello everyone,

As far as i see, ONVIF Protocol is just a bunch of SOAP-APIs, which are used to transmit informations about the camera and to trigger some scripts like moving etc. It seems that its definetely possible, but it needs a lot of effort to port it.

There are some implementation which may work:

  1. https://github.com/KoynovStas/onvif_srvd This seems to be incomplete, and i dont see any code for adding new functions. But it may provide a simple solution for adding this support.

  2. https://github.com/kristian/rpos-gateway This probably wont work on the Dafang due to the lack of ram for running nodejs. But it seems that the guys know how to implement the protocol.

If anyone have another reference impementation, please add it here.

nik0 commented 6 years ago

@EliasKotlyar Do you plan to add onvif?

EliasKotlyar commented 6 years ago

Not in the near future. Working on a different, more interessting topic now, which will make things little bit easier.

hyteoo commented 6 years ago

+1 on this, ONVIF is now so ubiquitous that all NVR software support it. Would be a great addition.

hyteoo commented 6 years ago

Another active repo that looks interesting: https://github.com/Tereius/libONVIF seems to cover more of the onvif spec.

nik0 commented 6 years ago

@hyteoo, We need to check but it seems there is some QT code. First we need QT ...

S474N commented 5 years ago

+1 for ONVIF support!

Is now support for main/sub streams?

k1ng440 commented 5 years ago

+1 for ONVIF support!

Benouzao commented 5 years ago

+1 for ONVIF Support!

EliasKotlyar commented 5 years ago

It doesnt help if everyone is writing "+1" in this issue. As i said in june: there are some options available but it will cost a lot of time to implement them. Unfortunately, nobody has the time yet to implement them

Benouzao commented 5 years ago

Thanks Elias for this amazing hack. The idea of the +1 is also for the community to share interest on what features are most wanted/needed. Keep up the great work!

jamman9000 commented 5 years ago

Hope this gets revived in the future. My NVR can't find the RTSP stream from my flashed Wyze cam but might if ONVIF was integrated. Going to try the rpos-gateway until then.

kurabii commented 5 years ago

+1 for ONVIF support

fwiw, I finally got audio to work on my hikvision NVR, I had to change encoding to PCM

@snjoetw - I picked up a laview NVR recently and plan on flashing it to the hikvision firmware, were you able to get the wyze cams to record to your hikvision? Did you have to set them up in any special way?

I ask not because I am lazy, but because I cant find it online and my nvr is still shipping. TIA

jmtatsch commented 4 years ago

Onvif has been added in a05a6e7 thanks to sian in #1296.

SparkyRedcar commented 4 years ago

+1 for ONVIF support fwiw, I finally got audio to work on my hikvision NVR, I had to change encoding to PCM

@snjoetw - I picked up a laview NVR recently and plan on flashing it to the hikvision firmware, were you able to get the wyze cams to record to your hikvision? Did you have to set them up in any special way?

I ask not because I am lazy, but because I cant find it online and my nvr is still shipping. TIA

Hi there, did you ever manage to get this working with a Hikvision NVR, I've tried and failed. It seems the only protocol my Hikvision NVR is offering is Hikvisions

fx-k commented 8 months ago

+1 for ONVIF support

fwiw, I finally got audio to work on my hikvision NVR, I had to change encoding to PCM

Hi sorry to bother u. Same here, I also use Hikvision's NVR and have applied the hacked firmware to my Dafang camera. Unfortunately, regardless of whether I change the audio stream encoding to PCM or any other format, the NVR fails to correctly read the camera's audio. (I have another camera that uses AAC-encoded RTSP, and it works fine.)

So, I would like to ask how you configured yours.

Additionally, ONVIF doesn't seem to work on my Hikvision NVR either. When I use an ONVIF scanning tool, it detects that ONVIF is listening on the 127.0.0.1 port, which might be the source of the problem.