WebThingsIO / onvif-adapter

ONVIF Profile S video camera adapter
Mozilla Public License 2.0
10 stars 6 forks source link

How do you add this adapter to gateway? #1

Closed drodbez closed 6 years ago

drodbez commented 6 years ago

Would love to help you build/test this adapter but first need to figure out how to add the ONVIF adapter to the list of adapters. Currently running the iot gateway on a raspi 3 b+ with latest 0.6.1.

mrstegeman commented 6 years ago

Extra testing would be great! The adapter is in a working state, we’re just trying to figure out a proper schema. If you’d like to test, you can do the following:

  1. Clone this repo into ~/.mozilla-out/addons
  2. Restart the gateway: sudo systemctl restart mozilla-iot-gateway
  3. Enable the adapter in the UI via Settings -> Add-ons

The primary thing I still need to get working is motion (and other) events. The camera I bought doesn’t properly support those, so I’ve been unable to test that feature.

mrstegeman commented 6 years ago

Oops, forgot something. After you clone the repo, you need to run ./package.sh inside the repo.

drodbez commented 6 years ago

Thanks @mrstegeman. Those directions worked and now my 4mp onvif profile s camera is added. I'm able to see the specs from the camera, it was fairly automatic ( just had to enter the username and password for camera ) I'd consider this issue is closed, maybe those directions can be added to a README.me for others.

During this discovery phase from what I've gathered

1) At the moment there is no way to view the video?

2) Based off the way the adapter is currently coded, it searches for ONVIF cameras through the adapter so you would be limited to only one camera?

3) Not sure the move/zoom functionality is set up correctly? X,Y,Z limits are capped at only -1, 0, +1 ( I imagine this is suppose to be the actually Pan/tilt

4) Another section should be added for both motorized and digital zoom.

5) Can't really do much under the rules section.

mrstegeman commented 6 years ago
  1. No, not yet. The RTSP stream URL is included as a property, but we've not yet decided if we want to stream that directly or transcode into something more web-friendly (MPEG-DASH, HLS, etc.)
  2. The adapter should find all cameras and add each of them. When you click the + button on the Things page, the adapter should search again for new cameras.
  3. The PTZ control parameters are velocities. See here.
  4. I'm open to suggestions! The full PTZ API is here.
  5. Yes, we'll get to that point once a proper schema is decided on. That's why this adapter isn't available through the Settings UI yet. :smile:

I'll go ahead and close this issue, but we can continue the discussion here. Alternatively, you can find me in Mozilla's IRC in #iot.

drodbez commented 6 years ago

What about keeping all options open for streaming and let the end user chose? (maybe have drop menu that is set to streams directly from RTSP as default, then the other options of chose to transcode into various formats?)

Which way is this debate currently leaning towards ?

I'd suggest adding ptz options, two-way talk and a triggered event section (push a button to unlock the door) That would cover like 99% of all usage,

This is probably for the gateway repo but it would also be cool if the web things add by WEB URL supported RTSP/HTTP URL string commands. This way you can add custom zoom in /zoom out, initiate 2 way audio, unlock door lucks etc via a http/rtsp url string on the things screen.

mrstegeman commented 6 years ago

There's not much of a debate at the moment. I'm going to start testing various solutions and see which one works best.

What do you think would work best for PTZ actions? There are a lot of things you can do, including adding presets and such.

drodbez commented 6 years ago

I think it's up to how far do you want to take this and how automatic should this be?
Also, will this only be pulled directly from the camera or recorder too? I would imagine more than likely most systems would have ONVIF IP cameras going into an NVR so they can record the footage. If the NVR has built in POE, their IP cameras gateway would be separate from the rest of the home system because the built in NIC cards typically keep them separate. This means the current setup as is would block all POE NVR users.

To counter this situation, if you want to record video to your NVR + have functionality for the smart home you almost essentially need control of the NVR (so the easiest method would be through http url strings in my opinion)

You could easily just allow programmable buttons that refer to preset URL strings which the end user defines. This potentially could give the end user more more control over their system ? But could also be tedious.

Example For a ptz section, we could have Pan Tilt Zoom buttons layed out nicely for the UI, where end user simply enter the URL string individually for each cameras PTZ option.

http://[host][:port]/PtzControl[/channelId] edit: you cant post host in carrots due to auto formatting by git

http://NVR_IP_ADDRESS:554/PtzControl/0/ZoomIn

So from this URL I would pull camera 1 (channel id = 0) from the NVR IP address, and tell it to zoom in.

This would let me pull cameras directly from a DVR/NVR IP address so I only need to change the channel ID. This also means, I'm not only limited to IP cameras but also gives support for analog coaxial cable based cameras that use the HDCVI, TVI, AHD, etc protocol.

Here is a document with virtually all of the http string URLs. here