Rotoclear C2
ONVIF Documentation

Get started

The Rotoclear C2 provides an ONVIF Profile S interface (Network Video Transmitter) for video management systems, recorders and ONVIF tools. It covers device management, one media profile per camera head with an MJPEG stream over RTSP, snapshots, digital PTZ, imaging settings, events and auxiliary commands. ONVIF runs inside the device software; no separate service has to be started.

  • Http API
  • WebSocket API
  • Kamerastream
  • Variablen
  • KI-Modul
  • GPIO-Modul

Activation and endpoints

ONVIF requires an active ONVIF license.

Zugriffsstufen

Item Value
Device service http://<device>/onvif/device_service
Other services Media, PTZ, Imaging, Events - addresses from GetServices / GetCapabilities
Ports The web server's HTTP port and, when enabled, its HTTPS port; additionally port 8000 for clients that saved the address of earlier firmware
Discovery WS-Discovery on UDP 3702 (multicast 239.255.255.250), can be switched off with SetDiscoveryMode
RTSP Port of the RTSP server

Service addresses (XAddrs) are reported with the address and port on which a request arrived. Changing the HTTP or HTTPS port changes the addresses; the device then announces itself again (WS-Discovery Hello). Scopes can be changed with SetScopes / AddScopes / RemoveScopes and are kept across restarts.

Authentication

ONVIF has its own users; the users of the web interface do not log in to ONVIF.

  • The ONVIF admin has its own user name and password, shown and changed in the web interface. It is always Administrator and can not be deleted. Its password may not be the password of the web admin.
  • Further users (up to 10 including the ONVIF admin) are created over ONVIF with CreateUsers and the levels Administrator, Operator or User. They are kept on the device and are not shown in the web interface.
  • User names: up to 32 characters, letters, digits and ._-. Passwords: up to 63 printable characters.
  • When no ONVIF user has a password, ONVIF is open without credentials.

Both standard methods are accepted:

Method Rules
HTTP Digest (MD5, qop=auth) Only nonces issued by the device, valid for 5 minutes. An expired nonce is answered with stale=true; the client repeats the request with the new nonce without asking for the password. Each response (nc/cnonce) is accepted once.
WS-Security UsernameToken (PasswordDigest) Created must be within ±5 minutes of the device clock. Each nonce is accepted once.

A recorded request can therefore not be sent again. Synchronise the client with GetSystemDateAndTime before using WS-Security; this call, GetCapabilities, GetServices and GetServiceCapabilities need no credentials.

Access levels

Level Allowed
Administrator Everything
Operator Everything except device settings and user management: streaming, profiles, encoder, PTZ, imaging, auxiliary commands, events
User All Get... requests except GetUsers, events (subscribe, pull, renew, unsubscribe, synchronisation point) and changing its own password

Administrator only: CreateUsers, DeleteUsers, GetUsers, SystemReboot, SetSystemFactoryDefault, SetHostname, SetNetworkInterfaces, SetDNS, SetNetworkDefaultGateway, SetNTP, SetSystemDateAndTime, SetNetworkProtocols, SetDiscoveryMode, SetScopes, AddScopes, RemoveScopes. A request beyond the user's level is answered with NotAuthorized.

Media profiles and streaming

The C2 has one MJPEG stream, shown for the active camera head. There is one fixed profile per head; clients may create further profiles (CreateProfile, up to 32), which are kept across restarts.

Profile token Video source Encoder
PROFILE_A CAM_A (head 1) MJPEG_A
PROFILE_B CAM_B (head 2) MJPEG_B

Starting the stream of a profile switches to its head, if connected. GetStreamUri returns rtsp://:/ for RTSP (UDP or TCP interleaved) and /rtsp_over_http on the web server port for RTSP over HTTP/HTTPS. RTSP accepts the ONVIF users and the web users. GetSnapshotUri returns /onvif-snapshot.jpg, the current camera image as JPEG, with HTTP Digest for the ONVIF users.

SetVideoEncoderConfiguration changes the camera stream - the same settings as the stream settings in the web interface, for both heads:

Setting Values
Encoding JPEG only
Resolution 1920×1080, 1280×720
Quality 40 to 85
FrameRateLimit 1, 5, 10, 15, 30 - other values are lowered to the next step
EncodingInterval 1

During a recording the stream settings are locked; the request is then answered with ter:ConfigurationConflict. There is no audio and no H.264.

PTZ

PTZ is digital (zoom and image section) and acts on the active head. Web interface, HDMI output and ONVIF share the same position.

Space Range
Absolute pan/tilt (PositionGenericSpace) x, y from -1.0 to 1.0 (centre 0, 0; y grows upwards)
Absolute zoom (PositionGenericSpace) 0.0 (widest) to 1.0 (maximum zoom)
Relative (TranslationGenericSpace) -1.0 to 1.0
Continuous (VelocityGenericSpace) -1.0 to 1.0, with timeout 1 to 10 s

Supported: AbsoluteMove, RelativeMove, ContinuousMove, Stop, GetStatus, GotoHomePosition, SetHomePosition, GetPresets, SetPreset, GotoPreset, RemovePreset.

Zoom changes keep the image centre. The home position defaults to fully zoomed out and centred. Up to 32 presets are stored; home and presets are kept across restarts. A preset stores a position only - it does not switch the head.

Imaging

GetOptions / GetImagingSettings / SetImagingSettings for CAM_A or CAM_B act on the camera image settings. All values are checked first, then applied to the camera; the web interface shows them at once.

ONVIF setting Range Device setting
Brightness -7 to 7 Brightness
ColorSaturation -7 to 7 Saturation
Contrast 1.0 to 2.5 Contrast (gamma)
Sharpness 0 to 15 Sharpness
Exposure mode AUTO, MANUAL Automatic exposure
ExposureTime (MANUAL) 0.01 to 1000 Exposure time
Gain (MANUAL) 0 to 42 Gain
WhiteBalance mode AUTO, MANUAL Automatic white balance
CrGain / CbGain (MANUAL) -128 to 127 Red / blue gain

Values outside the range are rejected with ter:SettingsInvalid. Focus is not motorised over ONVIF: a continuous focus Move and Stop are accepted without effect, absolute and relative focus moves are rejected.

Events

The event service supports PullPoint subscriptions (CreatePullPointSubscription, PullMessages) and Basic Notification (Subscribe with a consumer address). After subscribing, the current state is sent once (Initialized), then each change (Changed).

Topic Source Data
tns1:VideoSource/SignalLoss Source = CAM_A / CAM_B State true while the camera head is not connected
tns1:RecordingHistory/Recording/State RecordingToken = Recording IsRecording true while a manual recording runs; the visual backup is not reported

SetSynchronizationPoint of the event service makes the device send the current state again.

Auxiliary commands

SendAuxiliaryCommand (Device service) controls the active head. The commands are listed in GetCapabilities (AuxiliaryCommands).

Command Effect
LightOn, LightOff Light of the active head
RotationOn, RotationOff Disc rotation of the active head
ZoomIn, ZoomOut Digital zoom one step
Focus1, Focus2 Select sensor 1 or 2 of the active head

A command for a head or sensor that is not connected is rejected with a fault. The commands take the same path as the web interface: all clients see the change.

Device management

Area Operations Notes
Information GetDeviceInformation, GetCapabilities, GetServices Serial number and hardware ID are the MAC address.
Date and time GetSystemDateAndTime, SetSystemDateAndTime, GetNTP, SetNTP Manual time or NTP. NTP server set manually or taken from DHCP. The time zone and daylight-saving flag set over ONVIF are kept.
Network GetNetworkInterfaces, SetNetworkInterfaces, GetDNS, SetDNS, GetNetworkDefaultGateway, SetNetworkDefaultGateway, GetHostname, SetHostname IPv4, per interface DHCP or static, as in the web interface. A new address is announced with a Hello.
Protocols GetNetworkProtocols, SetNetworkProtocols HTTP can not be switched off over ONVIF (ONVIF itself runs on it). HTTPS and RTSP on/off and ports are applied like in the web interface.
Discovery GetDiscoveryMode, SetDiscoveryMode NonDiscoverable stops WS-Discovery (with Bye).
System SystemReboot, SetSystemFactoryDefault The device says Bye and restarts; it is back after about a minute. The factory reset is the one of the web interface: all settings including network, ONVIF users and the ONVIF admin (back to admin / super-secret!). Hard and Soft do the same. Not possible during a recording.

Not supported

  • H.264/H.265, audio, digital inputs and relay outputs (DeviceIO)
  • Profile G (recording search/replay), Profile T features, analytics and metadata streaming
  • IPv6, 802.1X, IP filter, certificate management over ONVIF

Troubleshooting

Symptom Check
Every request fails with NotAuthorized ONVIF license active; ONVIF user and password (not the web login); client clock within ±5 minutes when the client uses WS-Security (GetSystemDateAndTime)
Some requests fail with NotAuthorized The user's level - see Access levels
Client asks for the password again and again Client must accept stale=true and use the new nonce
Device not found by discovery Discovery mode enabled; client in the same subnet (multicast); firewall for UDP 3702
Encoder change rejected A recording is running - the stream settings are locked
Saved device address on port 8000 Still answered; new clients use the HTTP port