Cookies Setting
We use cookies to improve your browsing experience, analyze traffic, and personalize content. By using this site, you agree to our use of cookies. For more details, please check our Cookie Policy.
Home News

Overview of ONVIF and RTSP Protocols

Overview of ONVIF and RTSP Protocols
2025-06-18 Author: Lennon Page view: 18956

In IP-based video surveillance and multimedia streaming environments, it is essential to achieve smooth device integration, unified control, and stable real-time video transmission. To meet these demands, the RTSP and ONVIF protocols were introduced. RTSP (Real-Time Streaming Protocol) offers flexible control over media streaming sessions, while ONVIF (Open Network Video Interface Forum) establishes a universal standard for discovering, configuring, and integrating devices from different manufacturers. These protocols are widely used in security systems, often working together to deliver reliable video streams and streamlined device management. This article explores how RTSP and ONVIF function, how they complement each other, and how they are applied in practical surveillance scenarios.

 

What is the RTSP Protocol?

RTSP (Real-Time Streaming Protocol), defined in RFC 2326, is a real-time streaming protocol and an application-layer protocol within the TCP/IP protocol suite. The protocol mainly specifies how a set of multimedia applications can efficiently transmit media data over IP networks. RTSP operates on top of RTP and RTCP (with RTCP used for control transmission and RTP for data transmission) and supports data transmission over either TCP or UDP.

 

How Does the RTSP Protocol Work?

RTSP acts as a remote control for media servers. It doesn’t transmit media data itself; instead, it uses commands like:

OPTIONS – Query supported methods

The client asks the server which RTSP methods are supported for a specific media resource.

DESCRIBE – Get media description

The client requests details about the media (such as codec, format, and transport protocol). The server usually responds with an SDP (Session Description Protocol) file.

SETUP – Set up media transport

The client specifies how and where it wants to receive the media stream. The server responds with transport parameters and assigns a session ID.

PLAY – Start media playback

The client instructs the server to begin streaming the media data, typically using RTP.

PAUSE – Pause media playback

Temporarily suspends the media stream without ending the session, allowing playback to resume later.

TEARDOWN – End session

Terminates the media session and releases all associated resources on the server.

 

RTSP typically works with RTP (Real-Time Transport Protocol) for data transmission. Common video encoding formats in RTSP streams include H.264 and H.265, which ensure efficient compression and quality.

Advantages and Disadvantages of RTSP

Advantages:

- Real-time streaming with low latency
- Supports various codecs like H.264 and H.265
- Widely supported by IP cameras and media servers

Disadvantages:

- Not secure by default (unencrypted)
- Firewalls may block RTSP ports
- Doesn’t provide device discovery or control

 

RTSP Protocol Example in Wireshark


In Wireshark, you can observe RTSP packets using filters like `rtsp`. An RTSP session might show messages such as:
 

DESCRIBE rtsp://192.168.3.64:554 RTSP/1.0
SETUP rtsp://192.168.3.64:554/trackID=1 RTSP/1.0
PLAY rtsp://192.168.3.64:554/ RTSP/1.0

 

What is the ONVIF Protocol?

ONVIF (Open Network Video Interface Forum) is a global standard for the interface of IP-based security products such as IP cameras, video recorders, and access control systems.

ONVIF is not a communication protocol itself, but a standard specification that defines how IP security devices (like cameras, NVRs, VMS software) should communicate and interoperate, regardless of the manufacturer. It uses standard web services like SOAP over HTTP, XML, and often relies on underlying video streaming protocols like RTSP.

 

How Does the ONVIF Protocol Work?

1.Discovery: Devices use WS-Discovery to announce their presence.

2.Authentication: Devices can require user credentials for access.

3.Device Info Exchange: The client asks for details like model, firmware, and supported profiles.

4.Control & Streaming:

●PTZ control (if supported)
●RTSP URI for video stream
●Event notifications
●Configuration settings

ONVIF Profiles

ONVIF Profile is a set of functional specifications defined by the ONVIF organization to achieve interoperability between network video devices. Each Profile represents a fixed set of features, ensuring that as long as both the device and the client comply with the same Profile, they can achieve basic compatibility and connectivity regardless of brand differences. Commonly used Profiles are listed in the table below. By adopting ONVIF Profiles, system integrators and users can build and maintain video surveillance systems more efficiently.

 

Profile Purpose
Profile S Basic video streaming and configuration (widely used in IP cameras)
Profile G Recording and storage control
Profile T Advanced video (e.g., H.265, motion detection, analytics)
Profile A Access control configuration
Profile C Access control and edge storage
Profile M Metadata and analytics events (e.g., AI detection, line crossing)

Advantages and Disadvantages of ONVIF

Advantages:

- Ensures compatibility across different brands
- Supports device discovery and full control
- Secure options (HTTPS, user authentication)

Disadvantages:

- More complex than RTSP
- May have version compatibility issues between devices
- Can be slower to respond compared to direct RTSP

ONVIF Protocol Example in Wireshark
 

In Wireshark, ONVIF traffic usually appears as HTTP/XML .

Example: You can filter ONVIF communications using `http && xml`.


The figure shows that the device sent a series of HTTP POST requests to the server (accessing /onvif/device_service) using the ONVIF standard interface.

The server responded with HTTP/1.1 200 OK, indicating that the requests were successful and processed correctly by the server.

Differences Between RTSP and ONVIF Protocols

Feature RTSP ONVIF
Protocol Layer Application Layer Protocol Framework
Function Stream media Device discovery & control
Protocol Type Streaming control protocol Web service-based (SOAP/XML)
Transport Layer TCP/UDP HTTP/HTTPS
Security Basic (unless over TLS) Supports HTTPS, user auth
Application Live video feed Full device management
Example Use Case NVR fetching video stream VMS auto-discovering camera config



To summarize the above, RTSP is mainly focused on controlling media streaming sessions, such as play, pause, and teardown. ONVIF, on the other hand, is a broader protocol suite designed to standardize how IP video devices are discovered, configured, and integrated—often using RTSP for the actual media transport.
 

How RTSP and ONVIF Protocols Work Together

In practice, ONVIF is used to find and configure the camera, and then the RTSP URL is retrieved to start the live stream. 

Here’s a typical flow:

1. VMS discovers the camera using ONVIF.
2. VMS gets camera capabilities and RTSP stream URL.
3. VMS uses RTSP to stream live video from the camera.

So, ONVIF handles control, and RTSP handles streaming.

 

Applications of RTSP and ONVIF Protocols

Application 1:SPON IP Video Intercom with IP Camera

SPON management software has a built-in video module. When the camera is bound to the IP video intercom terminal via RTSP, the camera image can be previewed in real time on the module. The IP video intercom terminal also supports the ONVIF protocol and can be registered to the NVR for video image storage.
 

Application 2:IP speaker work with VMS or NVR

SPON IP speakers can be registered to a third-party VMS platform through the ONVIF protocol, and can implement broadcast or two-way intercom functions initiated by the platform. (Note: The platform must support broadcast or two-way intercom functions)
 

Conclusion

RTSP and ONVIF are both essential in modern video surveillance systems.
- RTSP is best for real-time video transmission.
- ONVIF is key for device discovery, configuration, and control.
Together, they ensure IP cameras are easily integrated, controlled, and used in diverse systems, from small homes to large-scale security setups.


 

FAQs

Q1: Can I use RTSP without ONVIF?

Yes. If you already know the RTSP stream URL, you can use it directly with a media player or NVR.

Q2: Why can’t my NVR find the camera automatically?

The camera may not support ONVIF or ONVIF discovery may be disabled.

Q3: Is RTSP secure?

By default, no. You can secure RTSP using RTSP over TLS (RTSPS), but not all devices support it.

Q4: How do I get the RTSP URL from an ONVIF camera?

Use ONVIF device manager software or send an ONVIF GetStreamUri command.

Q5: Which is better for remote control of PTZ cameras?

ONVIF is better for PTZ control since RTSP only streams video.