Free educational articles for physical security professionals.
Streaming technology has evolved rapidly since the 1990s. As consumer demand for capabilities such as pause, play, rewind, and fast-forward increased, vendors implemented proprietary protocols to address market needs. These proprietary protocols created problems of their own, including vendor lock-in.
The Open Network Video Interface Forum (ONVIF) standard and Real-Time Streaming Protocol (RTSP) have been essential vendor-neutral solutions to help address media-streaming use cases. RTSP, formalized in 1998 in RFC 2326, enables streaming between two endpoints. ONVIF, established in 2008, provides an open IP-based security and surveillance standard to reduce vendor lock-in and increase interoperability.
Interoperability – the purpose of ONVIF. (Source)
The “ONVIF vs RTSP” comparison is like comparing apples and oranges. One is a standard, while the other is a protocol. Take the analogy of electrical sockets and appliances. ONVIF is like a universal plug or socket standard that will help multiple appliances connect and work together. In contrast, RTSP is the electrical wiring protocol inside the appliance that handles the power flow.
However, industry professionals may use terms like ‘ONVIF protocol’ and ‘RTSP standard’ in conversations, making distinguishing the differences challenging for those less familiar with them. This article will thoroughly explore the topic of ONVIF vs. RTSP, including use cases, implementation details, and recommendations.
Monitor the health of physical security devices and receive alerts in real-time
Automate firmware upgrades, password rotations & certificate management
Generate ad hoc and scheduled compliance reports
The table below summarizes key differences between ONVIF vs RTSP that this article will explore in detail.
Attribute | ONVIF | RTSP |
---|---|---|
Type | Standard | Protocol |
Purpose | Interoperability | Stream Management |
Port | 80 | 554 |
Compliant Products | Most major brands like Axis, Hikvision, Sony, Dahua, etc. have ONVIF-compliant cameras
The full list of conformant products can be found on ONVIF.org |
All products that comply with ONVIF Profile S use the RTSP protocol. However, there are several more. You need to check the technical specifications of your camera to see if it uses the RTSP protocol. |
Advantages | Standardization of functions. ONVIF helps standardize different sets of functions (each standardized set is called a profile) related to video cameras. It gives you the same level of assurance in the context of cameras as the IEEE 802.11 standard gives you in the context of home devices like smartphones, laptops, printers, etc., communicating with each other. | Simplifies stream configuration and control. When streaming media with a server, RTSP helps you perform operations like PLAY, PAUSE, RECORD, etc. It also helps you agree to the right stream configuration (bitrate, format, resolution, fps) with the server before initiating data transfer. |
Limitations | Slower than the pace of innovation and some use cases don’t need the standard. If you are going to have just one IP camera and never add any more, or if interoperability is not a requirement, ONVIF compliance may not be relevant for you.
Also, the ONVIF standard may not always match the pace of technological development. For example, WebRTC became a popular alternative to RTSP long before it became supported by ONVIF in June 2024. |
Sub-optimal for peer-to-peer communication. RTSP is meant to facilitate client-server media stream management. With changing consumer behavior, peer-to-peer communication (for example, camera to smartphone) has become more popular, and protocols like WebRTC are becoming more popular. While still a very widely used protocol, RTSP is slowly becoming outdated. |
RTSP is an application-layer protocol that facilitates streaming media between two endpoints. It is designed for multiplexing and packetizing multimedia transport streams (such as video, audio, and interactive media).
Notably, the RTSP protocol does handle the transmission of streaming data. Transport protocols like Real-time Transport Protocol (RTP) and Real-time Control Protocol (RTCP) typically handle data transmission. While RTCP sounds similar to RTSP, it is only used to monitor the quality of the media stream during transmission. For example, RTCP provides feedback metrics like packet loss, jitter, latency, network congestion, etc.
RTSP uses TCP to maintain an end-to-end connection. Like HTTP, most RTSP commands are sent from the client to the server, but some flow in the reverse direction. Unlike HTTP, RTSP is a stateful protocol. This means that the protocol can maintain the state of the streaming session between a client (like a media player) and a server. The state maintenance helps the server keep track of information specific to the session, like the current playback position and stream configurations (resolution, speed, codec type, etc.).
A sequence diagram of dataflows between an RTSP client and servers. (Source)
Common RTSP requests include:
The above requests give you an idea of the use cases of the RTSP protocol. The ONVIF standard specifies RTSP for streaming, which means that any ONVIF-compliant camera will use the RTSP protocol for streaming. However, the standard uses other protocols for other functionalities, like HTTP for device management and SOAP (Simple Object Access Protocol) for device configurations.
The ONVIF standard focused on interoperability. It defines several profiles, each being a standardized set of features in a video camera or the clients (like network video recorders and video management systems). The table below describes the major profiles defined in the ONVIF standard.
ONVIF Profile | Use Case | Example Features |
---|---|---|
S | Live streaming | RTSP/RTP, video codecs, metadata. Also specifies control of PTZ (pan-tilt-zoom) commands |
G | Recording and playback | Store, search, retrieve, and playback recordings. This profile complements profile S and ensures compatibility between recording devices and storage devices/clients. |
T | Advanced streaming | H.265 and H.264, HTTPS-based secure communication, advanced metadata (including motion detection metadata). This profile is backward compatible with Profile S. If you want a camera to stream 4K video over a limited network connection, you may want this profile compatibility. |
C | Access control | Door control, credential management. Basically help the camera integrate with IoT security systems (like door locks). |
Q | Quick installation (Deprecated in April 2022) | Auto-discovery, initial setup. Secure default settings to enhance device security. |
A | Advanced access control | Extension of profile C. Role-based permissions, schedules. Enhanced event and alarm handling. |
M | Metadata and analytics | Metadata and analytics Object detection, motion tracking, event triggers based on analytics. This profile is compatible with Profile T for advanced streaming. |
A camera being ONVIF compliant means it complies with at least one of the profiles. Profile S is the most popular, and most modern IP cameras comply with it. Interestingly, profile S specifies the use of RTSP for streaming, which can contribute to the misuse of the terms ONVIF and RTSP in practice.
The ONVIF standard continuously evolves, and a new version is released every 6 months. As of this writing, the latest ONVIF version is 24.06, released in June 2024. This version publishes the WebRTC specification for peer-to-peer video streaming. In some ways, WebRTC is a competitor to RTSP, but their primary use cases differ. WebRTC is used for peer-to-peer video streaming (e.g., without a server, from your camera to your smartphone), whereas RTSP is used for server-to-client media streaming. Of course, if one of the peers is a server, WebRTC can effectively become an alternative to RTSP.
Over time, WebRTC is becoming more popular than RTSP because of the following factors:
The addition of WebRTC in the ONVIF specification will increase its popularity even more.
Engineers designing streaming solutions, such as IP camera systems, should understand the differences between ONVIF and RTSP and how they influence implementation decisions.
Here are five recommendations to keep in mind for your next project:
RTSP is a protocol, and ONVIF is a standard. The terms are often used interchangeably because most ONVIF-compliant cameras only comply with Profile S, which specifies RTSP as the streaming protocol. This implies that most ONVIF-compliant devices use the RTSP protocol. Understanding the “apples vs oranges” nature of the ONVIF vs RTSP discussion enables organizations to make better design and implementation decisions and deliver media streaming and security solutions that address real-world requirements.