Rotoclear C Pro
ONVIF Documentation
Einführung
The device provides an ONVIF Profile S interface (Network Video Transmitter) for video management systems, recorders and ONVIF tools. It covers device management, media profiles with RTSP streaming, snapshots, digital PTZ, imaging settings, events, the GPIO inputs and auxiliary commands. ONVIF runs inside the device software on the web server ports; no separate service has to be started.
Activation and endpoints
ONVIF requires an active onvif license. Without it all requests that need credentials are rejected.
| Item | Value |
|---|---|
| Device service | http://<device>/onvif/device_service |
| Other services | Media, PTZ, Imaging, Events, DeviceIO - addresses from GetServices / GetCapabilities |
| Ports | The web server's HTTP port (default 80) and, when enabled, its HTTPS port (default 443) |
| Discovery | WS-Discovery on UDP 3702 (multicast 239.255.255.250), can be switched off with SetDiscoveryMode |
| RTSP | Port of the RTSP server (default 554), RTSPS when RTSP over TLS is enabled |
Service addresses (XAddrs) are reported with the address and port on which a request arrived, so a client reaching the device through one interface gets addresses for that interface. Changing the HTTP or HTTPS port in the web interface changes the addresses; the device then announces itself again (WS-Discovery Hello).
Discovery announces the device with its scopes (type, profile, name, hardware, location). Scopes can be changed with SetScopes / AddScopes / RemoveScopes and are kept across restarts.
Authentication and users
ONVIF uses the device users of the web interface - there is no separate ONVIF password. 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.
User management over ONVIF (GetUsers, CreateUsers, DeleteUsers, SetUser) works on the device users. Reading users needs the user-settings read permission, changing them the user-settings write permission. The built-in admin user can not be deleted. The user level reported to ONVIF follows the user's permissions (Administrator, Operator, User). A user created over ONVIF gets the permissions of its level; the permissions of admin are not changed.
Media profiles and streaming
Two fixed profiles are always present. Clients may create further profiles (CreateProfile, up to 32) and combine the configurations below; created profiles are kept across restarts.
| Profile token | Video | Audio | Stream |
|---|---|---|---|
| DefaultH264 | H.264 or H.265 (follows the device's streaming format) | AAC 48 kHz, when a microphone is connected | rtsp://<device>:554/camera or /camera+audio |
| DefaultMJPEG | JPEG | - | rtsp://<device>:554/camera.mjpg |
GetStreamUri returns the URI for the requested transport: RTSP (UDP or TCP interleaved), RTSP over HTTP and RTSP over HTTPS (/rtsp_over_http?stream= on the web server port). The URI stays valid (Timeout PT0S). GetSnapshotUri returns /foto.jpg on the address of the request, the current camera image as JPEG; it asks for the credentials of a device user with stream permission.
| Configuration | Tokens | Notes |
|---|---|---|
| Video source | H1S1, H1S2, H2S1, H2S2 | Head 1/2, sensor 1/2. Starting a stream of a profile selects its head and sensor, if connected. |
| Video encoder | VideoEncoderConfigH264, VideoEncoderConfigMJPEG | Live resolutions 1280×720 and 1920×1080 (4K is for recordings only). The frame rate shown is the live frame rate. |
| Audio | AudioSourceConfig1, AudioEncoderConfigAAC | Reported only while a microphone is connected. |
| Metadata | MetadataConfig | No analytics metadata stream. |
| PTZ | PTZConfig | Digital PTZ, see below. |
SetVideoEncoderConfiguration changes the live resolution of the device (the same setting as in the web interface). Running RTSP sessions end when the resolution changes; the client starts a new session with the new size. Encoding, frame rate, quality, bitrate and GOP length must be sent as reported - other values are rejected with ter:ConfigModify. H.264/H.265 and the frame rate are set in the web interface.
PTZ
PTZ is digital (zoom and image section of the sensor) and acts on the active head and sensor - the one shown in the web interface. 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) |
| 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.
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 head or sensor.
Imaging
GetImagingSettings / SetImagingSettings / GetOptions act on the camera image settings. Changes go to the camera immediately and are shown in the web interface.
| 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 |
| YrGain / YbGain (MANUAL) | -128 to 127 | Red / blue gain |
Values outside the range are rejected with ter:SettingsInvalid. Focus is not motorised over ONVIF: GetMoveOptions reports speed 0, 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, up to 50) and Basic Notification (Subscribe with a consumer address, up to 10). GetEventProperties lists the topics. After subscribing, the current state of every source is sent once (Initialized), then each change (Changed).
| Topic | Source | Data |
|---|---|---|
| tns1:Device/Trigger/DigitalInput | InputToken = DigitalInput_1 ... DigitalInput_4 | LogicalState true/false - only with the GPIO module |
| tns1:VideoSource/SignalLoss | Source = video source token (H1S1, H1S2, H2S1, H2S2) | State true while the head or sensor of the source is not connected |
| tns1:RecordingHistory/Recording/State | RecordingToken = Recording | IsRecording true while a recording (normal, slow motion, time lapse) runs; the visual backup is not reported |
SetSynchronizationPoint of the event service makes the device send the current state of all sources again.
GPIO inputs
With an active GPIO module the four GPIO inputs appear as digital inputs (GetDigitalInputs, DeviceIO service) and as events (tns1:Device/Trigger/DigitalInput). Relay outputs are not offered over ONVIF; outputs belong to the GPIO bindings of the device.
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 (1/6 of the range) |
| 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. A time zone set over ONVIF and the daylight-saving flag are kept until the time zone is changed in the web interface. |
| Network | GetNetworkInterfaces, SetNetworkInterfaces, GetDNS, SetDNS, GetNetworkDefaultGateway, SetNetworkDefaultGateway, GetHostname, SetHostname | IPv4 only. A new address takes effect after a few seconds; the device announces it with a Hello. |
| Protocols | GetNetworkProtocols, SetNetworkProtocols | HTTP can not be switched off over ONVIF (ONVIF itself runs on it). RTSP can be switched off over ONVIF until the next restart; the setting of the web interface is not changed. Port changes are applied. |
| Discovery | GetDiscoveryMode, SetDiscoveryMode | NonDiscoverable stops WS-Discovery (with Bye). |
| System | SystemReboot, SetSystemFactoryDefault | SystemReboot restarts the device software. Factory default resets the device settings like the web interface. Both are refused while a recording is running. |
Not supported
- Profile G (recording search/replay), Profile T features, analytics and metadata streaming
- Audio output (backchannel), relay outputs, IPv6, 802.1X, IP filter, certificate management over ONVIF
- Switching HTTP off, permanently switching RTSP off over ONVIF
- Changing codec, frame rate, quality or bitrate over ONVIF (web interface only)
Fehlerbehebung
| Symptom | Check |
|---|---|
| Every request fails with NotAuthorized | ONVIF license active; device user and password; client clock within ±5 minutes when the client uses WS-Security (GetSystemDateAndTime) |
| Client asks for the password again and again | Client must accept stale=true and use the new nonce; check for a proxy that caches the Authorization header |
| Device not found by discovery | Discovery mode enabled; client in the same subnet (multicast); firewall for UDP 3702 |
| Stream ends after a resolution change | Expected - request GetStreamUri again and start a new RTSP session |
| No audio in the stream | Microphone connected; profile with audio configuration (DefaultH264) |
| Digital inputs missing | GPIO module active |