ONVIF explained: how IP camera discovery, streams and PTZ work
ONVIF is a standard set of web services that lets software find IP cameras on a network, ask each one for its video stream address, and control pan, tilt and zoom, whatever the brand. It does not carry video: the picture still arrives over RTSP. A server uses ONVIF to discover and configure cameras, then pulls RTSP from the address the camera reports.
Discovery: WS-Discovery on the local network
The server sends a WS-Discovery Probe as a UDP multicast to 239.255.255.250 on port 3702. Every ONVIF device on that network segment answers with its service address. Multicast does not cross routers or VLANs, so discovery only finds cameras on the server's own segment; others are added by IP address.
Profiles: what a camera promises
ONVIF groups features into profiles. Profile S covers live video streaming, audio, PTZ and basic configuration, and is the one most cameras support. Profile G adds on-camera recording and Profile T newer encoders such as H.265. A server that needs only live video and PTZ needs Profile S.
From profile to RTSP address
- The Device service names the camera's other services.
- The Media service (or the newer Media2) lists media profiles: typically a main stream at full resolution and a sub-stream at lower resolution.
GetStreamUrireturns the RTSP address for a chosen profile.- The server pulls that address over RTSP and reconnects when the camera drops.
Requests are authenticated with WS-UsernameToken or HTTP Digest, depending on the camera.
PTZ
The PTZ service accepts continuous moves (a speed on each axis until told to stop), moves to stored presets, and stops. A web page can drive it with press-and-hold buttons that send a move and then a stop.
When a camera does not answer
- ONVIF is off: many cameras ship with it disabled. Turn it on in the camera's own web page.
- Wrong user: some cameras keep a separate ONVIF user list from their web login.
- Clock skew: WS-UsernameToken includes a timestamp; a camera whose clock is far off may reject requests.
- Another segment: add it by address instead of discovery.
In creekX: Find cameras discovers ONVIF cameras on the server's network, pulls their RTSP stream with automatic reconnect and shows PTZ buttons when the camera supports them. Any camera with an RTSP address works without ONVIF. See IP cameras and RTSP to WebRTC.
Frequently asked questions
Is ONVIF a video protocol?
No. ONVIF is a set of SOAP web services for finding, configuring and controlling cameras. The video itself is RTSP, usually H.264 or H.265.
Do I need ONVIF to stream an IP camera?
No. Any camera with an RTSP address can be pulled directly. ONVIF adds discovery, the stream address lookup and PTZ control.
Why does discovery not find my camera?
WS-Discovery uses multicast, which does not cross routers or VLANs, and many cameras have ONVIF disabled by default. Add such a camera by its address instead.