ONVIF cameras and WebRTC direct from the camera
Updated 18 Oct 2026Two helpers for IP cameras: discovery over ONVIF — Castreon looks for the cameras on the network and gives you the correct RTSP address, without you looking it up in the manual — and WebRTC direct from the camera, for the lowest latency in the browser.
Available from Castreon 1.7.0. Discovery over ONVIF: the Pro and Enterprise editions. WebRTC direct from the camera: the Enterprise edition (like WebRTC). Adding a camera by its RTSP address stays in all plans — see IP cameras (RTSP).
Finding cameras over ONVIF
- Channels → new channel (or Edit), under Sources, Type → IP camera (RTSP).
- Fill in User and Password — the camera's.
- Find cameras (ONVIF) → Search the network. Within a few seconds the cameras that answered appear, with their name and model. Choose one.
- Read the profiles. Castreon shows the camera's profiles — usually a main stream and a secondary one — with codec, resolution and frames per second. The most suitable H.264 profile is marked recommended; for H.265 you see the browser warning.
- Use puts the profile's RTSP address into the source field. Then Test the camera and Save.
If the password is already saved on the source, the empty field uses the saved one. The password does not appear in responses, in the log or in the RTSP address put into the field.
Search the network works only if the Castreon server is on the same local network as the cameras: the cameras answer a multicast message, which does not cross routers. On a server in a data centre or on another network, type the camera's IP directly (with the port, if it is not 80) and press Read the profiles.
The camera's clock: if the camera's time differs a lot from the server's, the panel tells you. Castreon takes the difference into account when authenticating, but it is best to switch on NTP in the camera.
What it means technically
Discovery uses WS-Discovery (Probe on 239.255.255.250:3702), and reading uses the standard ONVIF services: the camera's time, device information, the Media service, the profiles and the stream address (GetStreamUri). Authentication is HTTP Digest or, on older cameras, WS-UsernameToken.
How much is verified: the implementation follows the ONVIF specification (Core and Media) and has been tried with a camera simulated from the specification's examples and with an independent ONVIF client — not yet on a physical camera. If a camera does not answer properly, the RTSP address from the manual always works.
Common problems
- “No ONVIF camera answered”: another network / subnet, ONVIF switched off in the camera (on many cameras it has to be switched on and a separate ONVIF user created) or multicast blocked by a switch / firewall. Type the camera's IP.
- “The camera refused the user name or password”: check the camera's ONVIF user and its clock.
- The camera gives no address for a profile: use another profile or the address from the manual.
WebRTC direct from the camera
Normally, WebRTC starts from the channel's stream (after the source is read and the channel is processed). With Direct from camera, WebRTC reads the camera directly, over a second RTSP connection — latency drops by everything the channel's processing adds.
- The channel's first enabled source must be IP camera (RTSP).
- Under Outputs, at WebRTC, tick Direct from camera and Save.
How it behaves:
- H.264 without B-frames is copied, without re-encoding. H.265 or H.264 with B-frames is re-encoded to H.264 (CPU).
- A single quality (no quality choice in the player).
- The camera must accept two RTSP connections at the same time (the channel and WebRTC).
- When the channel switches to a backup source, when the camera stops answering or when the option is switched off, viewers reconnect by themselves to the channel's stream — they always see what is on air. After a camera failure, Castreon waits one minute before trying the camera directly again.
- The channel page, under WebRTC, shows direct from camera while it is in use.
Tested end to end with a real RTSP server and a simulated camera (H.264 copied, H.264 with B-frames re-encoded, Opus audio), not with a physical camera.