Rivas Technology Group
Ajax Video Surveillance

Driver Documentation

build 30
What this driver is

A local Control4 camera driver for the Ajax Systems Baseline Video Surveillance IP cameras (TurretCam, BulletCam and DomeCam, baseline series). It talks to the camera directly over ONVIF on the local network.

There is no cloud service and no Ajax account involved: the camera's own ONVIF user, created in Ajax PRO, is all it needs. The camera's Ajax app keeps working alongside the driver.

What it does
Live video
Main and sub streams in Navigators (touch screens, the Control4 app, TV on-screen) through the Control4 camera proxy.
Detections
The camera's AI object detection (person, vehicle, pet, other), line crossings, motion and SD-card recording, as Control4 events, variables and conditionals.
Picture control
Day/Night, Wide Dynamic Range and picture levels as programming commands, limited to what the camera reports it supports.
History
Records for the Control4 app's History / Timeline, each with a playback link that opens the camera's SD recording at the moment of the event.
Device name
When the camera advertises its own name over ONVIF, the driver renames the Control4 device to match on connect. A name you typed is never overwritten, and the action Restore Device Name puts the first name back.
Durability
Settings, counters and playback links survive reboots and driver updates.
What it does not do
No snapshots
The baseline camera has no snapshot address (both ONVIF snapshot calls are refused) and only two video encoders, so there is no still image. Views that use snapshots (the 2-column multiview, History pictures) cannot show this camera's picture. A model that does offer a snapshot is detected and used automatically.
No PTZ or talk
No pan / tilt / zoom, no two-way talk, no Ajax alarm-system integration, nothing from the Ajax cloud.
No recording
The driver does not record video; the camera records to its own SD card and the driver links to it.
Requirements
Controller
Control4 OS 3.4.0 or later (History records with playback links need 3.4.0).
Camera
An Ajax baseline IP camera with ONVIF enabled in Ajax PRO and an ONVIF user and password. Tested firmware 2.1014, model sav533q-nand.
Network
The controller and every Navigator must reach the camera on the LAN. Give the camera a fixed address (DHCP reservation).
Ports
On the camera: 8080 ONVIF/HTTP, 8443 ONVIF/HTTPS (optional), 8554 RTSP video (Ajax does not use the usual 554). On the controller: the playback relay port. Nothing is opened to the internet.
Playback
An SD card in the camera with recording turned on in Ajax PRO.
In Ajax PRO (on a phone, as the installer)
  1. Open the camera: Settings › Service › Connection via ONVIF. Turn it on.
  2. Add an ONVIF user with a password. Write both down: they are the driver's Username and Password. Use letters and digits in the user name (a quote or control character is refused).
  3. Check the camera's time zone and that its clock is set automatically (NTP).
  4. For line-crossing events, draw the lines in the camera's detection settings and give each a clear name ("Driveway", "Front Gate"): the driver names its events after them.
  5. For event playback: SD card in, recording on.
In Composer
  1. Add the driver and set Camera IP Address, Username and Password. Leave ONVIF Transport on HTTP 8080 and ONVIF Port blank unless you have a reason (see Properties).
  2. Wait a few seconds. Status should read "Online" and the Camera Information properties (Manufacturer AJAX, Model, Firmware, Video Streams, Event Subscription "Subscribed") fill in.
  3. The driver fills in the camera page itself once the camera accepts the login, then reads it back. Camera Page says "verified", or exactly what to set if it did not take (then press Load Defaults on the camera page). Navigators take the Digest login from this page, so live view needs it in every Video Mode.
  4. Leave Video Mode on "Dynamic (H.265 / H.264)". Set the camera's streams as under Video & Audio.
  5. Refresh Navigators (Tools › Refresh Navigators) so they pick up the camera.
  6. Check live view on a touch screen and in the app, then walk in front of the camera: Detected Now and Last Event change, and a History record appears.
If the camera advertises a name over ONVIF, the device is renamed to match on connect. Composer's device tree and Navigators follow after a refresh. To undo it and keep your own name, run the action Restore Device Name.
How to tell it is working
Status
"Online". "Login refused" means the ONVIF user or password is wrong; "Camera not answering" means the address or port is wrong or the camera is off the network.
Camera Online
Since when. Video Streams shows both streams with codec, size and frame rate.
Event Subscription
"Subscribed (...)". Detection Lines shows the lines read from the camera.
SD Recordings
"replay main + sub" when playback is possible. Playback Relay shows "listening on".
Camera connection
Camera IP Address
blank
The camera's LAN address. Required. Changing it reconnects and issues new live links.
ONVIF Transport
HTTP 8080
HTTP 8080 or HTTPS 8443. The password is never sent on either (ONVIF sends a time-stamped digest). Over HTTP the digest exchange is visible on the LAN; HTTPS encrypts but cannot verify the camera's self-signed certificate. Choose HTTPS on a network you do not fully trust.
ONVIF Port
blank
Blank = 8080 or 8443 by transport. Set only if the camera's port was changed or a port forward is in the way.
Username
blank
The camera's ONVIF user from Ajax PRO. Changing it reconnects and issues new live links.
Password
blank
The ONVIF user's password. Never logged, never shown in a property, kept encrypted across updates. Changing it reconnects.
Video
Video Mode
Dynamic (H.265 / H.264)
How Navigators are given video. Dynamic, or Classic H.264 (sub stream) / Classic H.264 (main stream). See Video & Audio.
RTSP Port
blank = 8554
Only for a camera moved off 8554.
Full-Screen Stream
Main
Main or Sub. In Dynamic mode, which stream full-screen views use.
Advertise Camera Audio
Off
Off or On. Tells the camera proxy the camera has audio, once it is on G.711 u-law. See Video & Audio.
Detection
Clear Delay (s)
5 · 0-120
Seconds an object must be gone before a "Cleared" event fires. 0 clears at once. Raise it if lights flicker.
Line Cooldown (s)
0 · 0-600
After a line event, further crossings of the same line within this many seconds fire no event (they are still counted). 0 fires every crossing.
Ajax Detail Events
Off
On also subscribes to Ajax's own detection topic (twice a second), filling Live Objects and LAST_CONFIDENCE at the cost of steady extra traffic. Leave Off unless you program on confidence.
History
Record History
On
Master switch for Control4 History records. Composer events fire whatever this says; it only decides History.
History Severity
Info
Info, Warning or Critical for the records.
History: Person
On
Record person detections to History.
History: Vehicle
On
Record vehicle detections to History.
History: Pet
On
Record pet (animal) detections to History.
History: Other Object
Off
Record "other object" detections. Off by default: "other" is noisy.
History: Line Crossing
On
Record line crossings to History.
History Agent Device ID
blank
Leave blank; the History agent is found automatically. Enter its device ID only if Last History Result says the agent was not found.
Event playback
Event Playback
On
On gives records a playback link; Off records without one.
Playback Stream
Sub
Sub or Main. Sub plays smoother, especially remotely; Main has full resolution but is heavy.
Playback Pre-Roll (s)
5 · 0-120
Playback starts this many seconds before the event's camera time-stamp.
Playback Clip (s)
60 · 10-600
How long a link plays (the session ends 15 s after that).
Playback Link Days
7 · 1-90
How long a link keeps working. After that the record stays but playback is refused.
Playback Relay Port
blank
Blank = 20000 + the last four digits of the driver's device ID, the same on every boot. Set a port only if that one is taken on the controller.
Diagnostics
Debug Mode
Off
On prints the driver's log to Lua Output (the driver's Lua tab in Composer). Passwords are masked and links shortened. Turn it Off again when done.
The Camera Information properties (Manufacturer, Model, Firmware, Serial Number, Camera Name, ONVIF Services, Video Streams, Audio, Snapshots and the rest) are read-only, filled from what the camera reports.
Licensing
License Key
empty
The driver runs fully for a 14-day free trial from first install — no key needed. Before the trial ends, paste the key from your Rivas Technology Group purchase confirmation: the driver activates it with the Rivas licensing service, binds this one controller, and keeps the signed grant so it stays licensed even when the controller is offline.
License
Read-only. Shows the current state: Trial — N day(s) left, Licensed (perpetual), Licensed, grant good N more day(s) for a subscription, or Trial expired — license required. When the trial ends with no valid key, the release build stops live streams and events until a key is entered (the camera is not life-safety, so it may lock).
Activation needs the controller to reach the internet once; after that the driver re-checks daily and tolerates a long offline stretch. Keys are managed in LEGION — contact Rivas to reissue, transfer or resend one.
Streams and codecs

The camera has two streams: main (3840×2160 on the test camera) and sub (720×480). Both ship as H.265. The driver reads the codec from ONVIF Media2, because Media1 on this camera reports H.264 for streams that are really H.265. The Video Streams property shows what it found.

Video Mode, and when to use each

Dynamic (H.265 / H.264)
default
The one to use. Navigators get each stream as a complete address with codec, size and frame rate. The camera's RTSP accepts only a Digest login, answered from the camera page. Navigators pick the stream: tiles and the waterfall the sub, full screen the main.
Classic H.264 (sub stream)
The camera proxy's H.264 mode: the driver gives only the stream's path and the Navigator builds the address from the camera page. That stream must be H.264 — run the action Set Sub Stream to H.264 once.
Classic H.264 (main stream)
The same with the main stream; it must be H.264 too.
Composer's camera test cannot test H.265. After changing Video Mode, refresh Navigators.
Recommended Ajax camera settings

Ajax PRO: camera › Settings › Video stream / Image. The camera ships with a 4K main stream at only 1,800 kbps, which smears any motion.

Main stream
H.265, 2560×1440, 15-20 fps, VBR, 4,000-6,000 kbps, VBR quality 70-80, GOP = frame rate. Use 1920×1080 at 3,000-4,000 kbps where most viewing is on phones or away from home.
Sub stream
H.264, up to 1280×720, 20 fps, VBR, 800-1,000 kbps, VBR quality 60-70, GOP 20. This is what tiles, the waterfall and remote phones use.
Image
Anti-flicker 60 Hz in North America; Noise reduction on; WDR on at level 2-3 for bright-and-shaded scenes; Image preferences a notch or two toward "Less motion blur"; Vivid mode off for true colours; Day/Night and IR on Auto.
A higher main bit rate fills the SD card 3-4× faster and costs more data when viewing the main stream away from home.
Audio

The camera sends G.711 A-law (PCMA). Control4 camera audio plays G.711 u-law (PCMU), so out of the box Navigators play no camera audio. The Audio property says which the camera uses.

The action Set Audio to G.711 u-law switches the camera's audio encoder to u-law; it changes only the encoding, reads it back and reports in Last Command. It is never done automatically, because it also changes what the camera's own recordings and the Ajax app get. Turn on Advertise Camera Audio once the camera is on u-law, and turn on the camera's microphone in Ajax PRO.

Events, variables, conditionals

The driver subscribes to the camera's ONVIF events (object detection, line crossing, recording, motion) and keeps the subscription alive (renewed every 5 minutes, re-made if the camera drops it, with a watchdog for silence). Detection settings themselves — zones, sensitivity, classes — are made in Ajax PRO.

Events

Composer: When <camera> …

Person Detected / ClearedVehicle Detected / Cleared Pet Detected / ClearedOther Object Detected / Cleared Any Object DetectedAll Objects Cleared Motion Detected / ClearedLine Crossed Line Crossed by Person / Vehicle / Pet / OtherLine Crossed: <line> Recording Started / StoppedDay Night Mode Changed Camera Online / OfflineLogin Failed
Variables
Booleans
CAMERA_ONLINE, PERSON_DETECTED, VEHICLE_DETECTED, PET_DETECTED, OTHER_DETECTED, ANY_OBJECT_DETECTED, MOTION_DETECTED, RECORDING_ACTIVE.
Text
DETECTED_CLASSES, LAST_DETECTION_CLASS, LAST_EVENT, LAST_EVENT_TIME, LAST_LINE, LAST_LINE_CLASS, DAY_NIGHT_MODE, CAMERA_MODEL, CAMERA_FIRMWARE.
Numbers
LAST_CONFIDENCE, and PERSON / VEHICLE / PET / OTHER and LINE_CROSSINGS, each _TODAY and _TOTAL.
Per line
LINE_<NAME>_TODAY, _TOTAL and _LAST_CLASS, where <NAME> is the line's name in capitals (a line "Front Gate" gives LINE_FRONT_GATE_TODAY).
Counters
_TODAY reset at midnight (controller time); _TOTAL keep counting. Both survive reboots and updates. An object in view is counted once per appearance, not per second.
Line names

Lines are drawn and named in Ajax PRO. The driver reads them from the camera's rules when it connects (Detection Lines lists them) and gives each its own "Line Crossed: <name>" event and LINE_<NAME>_ variables. After adding or renaming a line, run Refresh Camera Info, then refresh Composer's programming view. At most 32 lines; names are cut to 64 characters.

Commands

Composer: Device Actions on the camera. Each writes to the camera, is checked against what the camera reported it supports, clamps a level to the camera's range, then reads the setting back. A refused write changes nothing and says why in Last Command. Writes need the camera online.

Set Day/Night mode
Auto / Day / Night. Day = colour (IR-cut filter on), Night = black and white with IR, Auto = the camera decides.
Set WDR
On / Off. Wide dynamic range, for back-lit scenes.
Set picture level
Brightness, contrast, saturation or sharpness, 0-100, clamped to the camera's range.
Actions

Composer: the driver's Actions tab.

Refresh Camera Info
Read everything from the camera again (streams, lines, recordings).
Resubscribe Events
Make a new event subscription.
Reset Today / All Counters
Clear the today or lifetime counters.
Set Audio to G.711 u-law
Switch the camera's audio encoder to u-law. Writes to the camera.
Set Sub Stream to H.264
Switch the sub stream's encoder to H.264, keeping its resolution and bit rate; the stream list follows. Needed for the Classic sub-stream mode.
Restore Device Name
Put back the name the device had before the driver first renamed it, and stop following the camera's ONVIF name.
Examples
  1. Porch lights at night. When Person Detected, If it is after sunset, turn on Porch Lights. When All Objects Cleared, delay 2 minutes, turn them off.
  2. Driveway arrival. When Line Crossed: Driveway, If Vehicle is Detected, announce "Car in the driveway" and turn on the garage lights.
  3. Camera down alert. When Camera Offline, send a push notification. When Login Failed, notify the installer (someone changed the ONVIF password).
  4. Busy day. When Person Detected, If PERSON_TODAY > 50, send an email once.
How records are made

Each detection that is switched on makes one record in the Control4 History (category Cameras, subcategory IP Camera), attached to the camera proxy so it shows on the camera in the app's History / Timeline and can raise a push notification there. Types: Person, Vehicle, Animal (a pet), Other Object and Line Crossing.

The per-type History properties choose what is recorded. Composer events fire whatever these say; they only decide History. Recording and camera online / offline are not History records — use the RECORDING_ACTIVE and CAMERA_ONLINE variables and their events instead.

The camera has no snapshot. Person, Vehicle, Animal and Line Crossing rows show the app's own icons; Other Object rows show the driver's icon. No camera image is attached.
Playback, and why through a relay

Each record of a detection carries a playback link. The camera can only seek its SD recording when the player sends an RTSP Range: clock= header, and the Control4 app can only open a URL. So the link points at a small RTSP relay in this driver on the controller. When the app opens it, the relay opens the camera's SD recording with the camera's Digest login, asks it to seek to the event, then passes the video through. The camera login never appears in the link.

Playback works remotely through Control4's remote access, though main-stream playback may be choppy there. The camera records H.265; a player that cannot play H.265 will not play it.

After updating from an earlier build

Every setting is kept across a driver update. After an update, refresh Navigators and close and reopen the app, so they ask the driver for the stream addresses again.

Security notes
The password
Never written to the log (masked in Debug Mode too), never shown in a property or variable, and stored across updates in Control4's encrypted store. The driver's backup file holds it sealed with a key derived from the controller.
Playback links
Secrets. Anyone on the LAN (or via remote access) who has a link can watch that clip until it expires after Playback Link Days. The relay only lets a connection play once its first request names a valid link, forwards only the RTSP methods and headers a player needs, and caps at 4 viewers (a fifth replaces the oldest).
Stream addresses
In Dynamic mode the camera login travels to Navigators inside the stream address, so anything that can read those addresses holds the camera login. Give the camera an ONVIF user of its own, used for nothing else.
Network
Keep the camera on a trusted network or a camera VLAN the controller and Navigators can reach. Do not port-forward the camera or the relay to the internet.
Troubleshooting
No video, Status Online
Refresh Navigators, then close and reopen the app. The camera page must show RTSP port 8554, Authentication Type Digest and the ONVIF login (press Load Defaults). Video Mode should be Dynamic; in a Classic mode the stream must be H.264.
Slow to start
Lower the main stream's bit rate to 4,000-6,000 kbps and keep GOP = frame rate, or set Full-Screen Stream to Sub.
No picture in multiview
The 2-column view needs snapshots; this camera has none. Use the waterfall view.
Login Failed
The ONVIF user or password is wrong, or ONVIF was turned off in Ajax PRO. The driver retries after a minute, then every five.
Camera Offline
Wrong address or port, camera off the network, or a firewall on 8080. It retries, slowing to every 5 minutes, and goes Online by itself when the camera is back.
Playback refused
The link is older than Playback Link Days, Event Playback is Off, or SD Recordings shows no replay (no card, recording off).
No History entries
Check Record History and the per-type History properties, check Last History Result (the History agent must be in the project), and check the detection is enabled on the camera in Ajax PRO.
Line events missing
Run Refresh Camera Info so the driver reads the camera's rules.
Clock offset
The driver signs every request in camera time, so a wrong camera clock does not break the login, but playback lands at the wrong moment. Turn on automatic time in Ajax PRO.
Rivas Technology Group
Designed together. Built to disappear.
Rivas Technology Group
425-954-6003
Email
sales@rivastechgroup.com