Siwenoid Wiki

CCTV cameras (ONVIF, RTSP, Hikvision, Dahua)

Connecting IP cameras and video recorders, getting the cameras in, defining PTZ presets, assigning cameras to datapoints and opening them at an alarm.

At a glance
Devices IP cameras, NVRs and DVRs
Handler type CCTV - ONVIF, CCTV - RTSP, CCTV - Hikvision, CCTV - Dahua
Protocol ONVIF, RTSP, Hikvision Device Network SDK, Dahua NetSDK
Live view separate viewer window on the operator PC
Datapoints browse (ONVIF, Hikvision, Dahua), by hand (RTSP)
Platform Windows

Siwenoid connects IP cameras and video recorders as containers of the physical structure, with one datapoint per camera. Cameras can be assigned to any datapoint: when that datapoint alarms, the cameras open on the operators' PCs and PTZ cameras turn to the assigned preset. Operators can also open a camera by hand (see Cameras (CCTV)).

The live picture is shown in a separate viewer window on the operator PC. The video goes straight from the camera or recorder to that PC, not through the Siwenoid server. Siwenoid shows live video only: it has no playback and does not start recordings.

Camera types

ONVIF RTSP Hikvision Dahua
Handler type CCTV - ONVIF CCTV - RTSP CCTV - Hikvision CCTV - Dahua
Protocol ONVIF RTSP Hikvision Device Network SDK Dahua NetSDK
Devices ONVIF cameras and recorders of any make any camera or encoder with an RTSP stream Hikvision recorders Dahua recorders
Connection supervision ONVIF connection none (the cameras are not supervised) vendor SDK login vendor SDK login
Getting the cameras in browse by hand browse browse
PTZ presets at an alarm yes no yes yes
Device events as statuses yes no no no

Only camera datapoints count as licensed datapoints; recorder and device nodes are free.

Requirements

See also System requirements.

Enabling the CCTV service

The CCTV service is switched on separately in the server and in each client, in config\config.xml (see Configuration files). Both files contain it commented out. Add it inside <Services>:

<Services>
    <CCTV/>
</Services>
Where What it enables
Server Turning PTZ cameras to their presets at an alarm. Camera connections, browsing and ONVIF events work without it.
Client The viewer and every camera function of the operator's screens: the Show live video menu items, the cameras in the info pane, automatic opening at an alarm. Without it the client shows no camera at all; the Preferences can still configure cameras.

Restart the server or the client after the change. The client starts the viewer at every login and closes it at logout. In a hot standby pair, enable the service on both servers (see Hot standby server pair).

Preparing the devices

On the device side:

ONVIF enabled and a user created on a Hikvision camera (Network › Advanced Settings › Integration Protocol).
ONVIF enabled and a user created on a Hikvision camera (Network › Advanced Settings › Integration Protocol).

Warning

Repeated wrong passwords can lock the account on some recorders. Check the user name and password before you switch the container on.

Creating the camera container

Create the containers in Preferences › Physical structure (see Physical structure for the editor in general). Each ONVIF camera or recorder and each Hikvision or Dahua recorder needs a container of its own. RTSP cameras can share one container: any number of cameras can be added under one RTSP container.

  1. Click + above Physical Containers.
  2. Enter the Name.
  3. Choose the Handler type and its Protocol from the table above.
  4. Fill in the Connection parameters as the table below shows. For an RTSP container the name is enough: leave the connection parameters empty.

The container editor of an ONVIF camera with its connection parameters.
The container editor of an ONVIF camera with its connection parameters.

Field ONVIF RTSP Hikvision, Dahua
Host IP Address of the camera or recorder. Not needed: leave it empty. If you enter an address anyway, the container shows only whether this one address answers a ping; it does not check the cameras or the video. Address of the recorder.
Port The device's ONVIF (HTTP) port, usually 80. Not needed; the stream's port is part of the RTSP URL of each camera. The SDK port of the recorder: usually 8000 for Hikvision, 37777 for Dahua.
Username The ONVIF user. Leave empty if the device needs no login. (not on the container; set on the camera datapoint) The recorder account. Required.
Password The ONVIF user's password. (not on the container; set on the camera datapoint) The recorder account's password. Required.

The ONVIF, Hikvision and Dahua forms have no default port: always enter the port set on the device. The Hikvision and Dahua user name and password fields are prefilled with a placeholder: replace them with the recorder's own account. A stored password shows Stored, leave empty to keep it.

Save the container. Saving creates its device datapoint. Then switch the connection on with the On / Off toggle beside the name. Every login detail of an RTSP camera (RTSP URL, user name, password) is on the camera datapoint, so its live video works independently of the container's connection, even with the container switched off.

Getting the cameras in

A camera is a datapoint of type CAMERA (ONVIF, RTSP) or IP_CAMERA (Hikvision, Dahua) under the container. Only these datapoints offer the live video.

ONVIF: browsing

  1. Wait until the container is connected, then click Browse datapoints.
  2. In Select datapoints to import, untick the datapoints you do not want. The legend shows what is New, Modified, Unchanged or Only in DB. Tick Total sync (delete existing datapoints not in selection) only if datapoints missing from the device should be deleted.
  3. Click Import, review the lists in Confirm import and confirm.

Every media profile of the device becomes a camera datapoint with its stream address and the container's login. A recorder also gets a recorder datapoint, and its cameras are named after the recorder and the channel, for example NVR / Entrance (Profile1, Main). An Event Subscription datapoint is created under the container as well.

Each imported camera is at once available as a camera assignment (the camera itself, without a preset), so it can be assigned to datapoints straight away.

Hikvision and Dahua: browsing

Wait until the container is connected, then click Browse datapoints. Siwenoid asks the recorder for its channels and creates a recorder datapoint with one camera datapoint per channel, named as the recorder names the channel. Browsing again updates the list.

RTSP: by hand

RTSP cameras cannot be browsed. Any number of cameras can be added under one container. For each camera:

  1. Right-click the container in the physical tree and choose Add child.
  2. Enter the Name and choose the type CAMERA.
  3. Fill in the protocol parameters below and click Save.

Camera datapoint fields

Browsing fills these fields; check them in the datapoint editor under Protocol parameters.

Type Field Meaning
ONVIF Serial no Serial number of a recorder (recorder datapoint only).
ONVIF Source token The video source of the camera on the device. Device events of this source arrive on this camera.
ONVIF Profile token The media profile played and used for PTZ.
ONVIF Stream URI The RTSP address of the profile's stream.
ONVIF Username, Password Login for the stream; copied from the container when browsing.
RTSP RTSP URL The full stream address, with the camera's address, port and the channel or stream wanted, for example rtsp://192.168.1.20:554/stream1. Required, at most 511 characters.
RTSP Username, Password Login for the stream, if the camera needs one.
Hikvision, Dahua Channel number The recorder channel of the camera. Required.
Hikvision, Dahua Substream Play the recorder's secondary stream (usually lower resolution) instead of the main stream.

PTZ presets

Siwenoid does not read the presets from the camera: enter the ones you need by hand, per camera.

  1. In the physical tree, select a saved camera datapoint and open the tab CCTV preset assignments.

  2. Click + under Presets.

  3. Fill in the fields:

    • Assignment name: for example Gate,
    • Preset identifier: see the table below.
  4. Click Save.

Type Preset identifier
ONVIF The preset's token in the device.
Hikvision, Dahua The preset's number in the recorder (a whole number).
RTSP No PTZ.

An assignment with an empty Preset identifier stands for the camera itself: it opens the camera without moving it. Removing a preset with - removes it from every datapoint it was assigned to.

The presets of a camera, one of them open in the editor.
The presets of a camera, one of them open in the editor.

Assigning cameras and presets to datapoints

Assign the cameras (and presets) that should open when a datapoint alarms. You need the Manage physical hierarchy and Edit CCTV assignments permissions (see Users and groups); without them the lists are read-only.

One datapoint

  1. In Preferences › Physical structure, select the datapoint and open the tab CCTV assignments.

  2. Tick the cameras and presets to assign; untick those to remove. The bold row with the camera icon is the camera itself, without a preset; the camera's presets are listed under it.

    Text typed in Search... filters the list by the name of the camera or the preset.

  3. Click Save.

The assigned items are listed on top under Assigned cameras and presets, the rest under Other cameras and presets. Ticking a camera row creates the camera's own assignment if it has none yet (this is the quickest way for Hikvision, Dahua and RTSP cameras).

The CCTV assignments of a datapoint: assigned items on top, the other cameras and presets below.
The CCTV assignments of a datapoint: assigned items on top, the other cameras and presets below.

Several datapoints at once

Select several datapoints in the physical tree and open the tab CCTV assignments of the multi-selection editor. A ticked row is on every selected datapoint, a half-ticked row only on some. Only the rows you change are saved: a ticked row is added to every selected datapoint, an unticked one is removed from every one.

The multi-selection editor: a half-ticked preset is assigned to only some of the selected datapoints.
The multi-selection editor: a half-ticked preset is assigned to only some of the selected datapoints.

From a map

In the in-place map editor (edit mode, see Map preferences and the map editor), right-click a datapoint button and choose Edit CCTV assignments, or with several buttons selected Edit CCTV assignments of the selection. The same list opens in a dialog; Save stores the assignments at once, independently of the map edit.

Opening cameras at an alarm

Cameras open automatically through an Open CCTV task (Preferences › Tasks, see Tasks). In the task, tick the treatment categories that should open the cameras and choose the users and groups whose PCs open them.

When a new status of a ticked category arrives on a datapoint that has camera assignments:

  1. The server turns each assigned preset's camera to that preset. Several presets of one camera are called one after the other, so the camera ends at the last one; assign one preset per camera.
  2. The viewer opens each assigned camera once on the PCs of the task's users, as far as their object restrictions let them see the camera.

The presets move only when the server runs the CCTV service and the camera's container is switched on and connected. The cameras open only on clients that run the CCTV service. Acknowledging the status does not close the video.

ONVIF device events

An ONVIF container subscribes to the events of the device. The events the device publishes (as configured and armed on the device) arrive as statuses of the camera whose video source they belong to; the state of the subscription itself is shown on the Event Subscription datapoint. Adjust their treatments in Preferences › Datapoint types (see Datapoint types, treatments and commands).

If the device refuses the user name or password, Siwenoid stops asking it for events, so that the account is not locked. Correct the login, then switch the container Off and On again.

Checking the setup

  1. Switch the container on and wait until it is connected. A lost connection appears as a status in the signal log.
  2. In the operator's datapoint hierarchy, right-click a camera and choose Show live video. The viewer window shows the picture. If the menu item is missing, the client does not run the CCTV service.
  3. Raise a status of a ticked category on a datapoint with assigned cameras, on the device or with Simulate in the info pane (see Datapoint hierarchy; a simulated status is real for every operator). The cameras open and PTZ cameras turn to their presets.
  4. If the picture does not appear on one PC, check that this PC reaches the camera or recorder, and that the client is started from its installation folder (the viewer is installed in its cctv folder).