When streaming video between IoT devices, selecting the most suitable video streaming protocol is crucial. Broadly speaking, video streaming protocols are different sets of rules and standards that dictate how video data is transmitted over the internet.
Essentially, video streaming protocols dictate how to segment video content into small, manageable chunks of data. These chunks are then sent over the internet to the viewer’s device, where they are reassembled and played back in real-time. However, there are different protocols to implement depending on what you’re streaming and how.
Selecting the correct protocol ensures the video streams smoothly, even with limited internet speeds. The protocols help maintain streaming quality and ensure compatibility.
In the context of IoT applications, such as surveillance camera streaming, video streaming protocols need to enable low latency to prevent lag. This need for real-time performance requires specific protocols designed to handle the distinctive demands of IoT applications, which differ from those used by streaming subscription services like Netflix.
How video streaming protocols work
The streaming process involves several steps: encoding, segmentation, transmission, and decoding. It also relies on three essential components: a codec, a protocol, and a container.
The first step to streaming is encoding, in which the video content is compressed into a digital format using a codec. Once the video is encoded, it is segmented into smaller, more manageable pieces. These segments allow the video to be transmitted in parts, which is crucial for maintaining a smooth and uninterrupted viewing experience.
After segmentation, the video segments are transmitted over the internet according to the chosen protocol. The segments are then decoded back into a viewable format.
Codec
A codec – short for “coder-decoder” – is a tool that compresses and decompresses digital video files. The primary function of a codec is to reduce the file size of the video without significantly degrading its quality. This makes it easier to store and transmit video files over the internet.
Codecs use various algorithms to encode the video data at the source and decode it at the destination.
Protocol
A protocol is a set of rules that dictate how data is transmitted over a network. Video streaming protocols manage the packaging, transmission, and unpacking of video data, ensuring that it can travel from the server to the viewer’s device efficiently and reliably. Protocols manage various parts of the video streaming process, including buffering, error correction, and synchronization, with the goal of providing a smooth viewing experience.
Container
A container is a file format that bundles together various multimedia components, such as video, audio, subtitles, and metadata, into a single package. This makes it easier to store, transmit, and manage the multimedia content. Common container formats include MP4, MKV, AVI, and MOV.
Containers do not encode or compress the multimedia data themselves; instead, they rely on codecs to perform these tasks. The container simply holds the encoded video and audio streams produced by codecs like H.264, H.265, VP8, and VP9. For example, an MP4 file might contain video compressed with H.264 and audio compressed with AAC.
Best streaming protocols for IoT
When it comes to streaming video for IoT applications, choosing the right protocol is crucial for ensuring high-quality, reliable, and low-latency communication. The nature of IoT devices demands specific protocols that can handle real-time data transmission efficiently.
Secure Reliable Transport (SRT)
Developed by Haivision, the Secure Reliable Transport (SRT) protocol focuses on delivering high-quality, low-latency video over networks with varying performance levels. It uses advanced error correction techniques to ensure smooth video delivery even under challenging conditions, such as high traffic, which can cause congestion and slow data transmission, or intermittent connectivity, in which the network connection is unstable or frequently drops.
SRT is particularly beneficial for IoT applications because it can handle fluctuations in network performance, making it ideal for environments in which stable network connectivity is not always available.
SRT’s ability to recover from packet loss, in which data packets fail to reach their destination, and compensate for jitter, which refers to variations in packet arrival times, ensures that video streams remain uninterrupted and of high quality. Additionally, SRT includes strong encryption features, providing a secure channel for video transmission, which is essential for applications involving sensitive data, such as surveillance and remote monitoring.
Real-Time Streaming Protocol (RTSP)
Real-Time Streaming Protocol (RTSP) is a network control protocol widely used in entertainment and communications systems to control streaming media servers. It is ideal for real-time applications like surveillance because it allows for direct control of playback functions such as play, pause, and stop.
By managing the connection and stream setup processes, RTSP enables smooth communication between devices, making it a preferred choice for live video feeds from IoT devices. RTSP is commonly paired with Real-time Transport Protocol (RTP) for actual media data transmission, which enhances the system’s reliability and performance. RTP handles the delivery of audio and video data, while RTSP manages the control and setup, resulting in a more resilient and efficient streaming system.
WebRTC
WebRTC is a versatile protocol developed by Google that enables real-time communication directly between browsers and devices without the need for plugins. WebRTC’s peer-to-peer nature reduces the need for intermediate servers, which can help lower costs and improve performance in IoT networks.
WebRTC supports audio, video, and data transmission, offering a comprehensive solution for various IoT communication needs. However, WebRTC’s peer-to-peer architecture can limit scalability compared to server-based solutions like RTSP. As the number of connected devices increases, managing direct connections can become complex, and network traversal techniques – such as STUN, TURN, and ICE – may be necessary to handle firewalls.
Which codec?
Choosing the right codec is crucial for ensuring efficient video streaming and storage, especially in applications like surveillance, in which high-quality video and efficient data management are essential. Understanding the differences between codecs helps in selecting the appropriate technology for specific use cases.
H.264 (AVC) and H.265 (HEVC) are codecs that are used to encode and decode video data efficiently. They are not tied to any specific protocol and can be used with a variety of streaming protocols to deliver high-quality video content. VP8 and VP9 are two additional codecs that are occasionally used, but they are not as common.
H.264 (AVC)
H.264 has been the industry standard for many years and is widely supported across a vast range of devices and platforms, including older hardware. It is widely used in surveillance systems due to its excellent balance between compression efficiency and video quality. It provides good quality video at relatively low bitrates, which is essential for continuous streaming and storage.
H.265 (HEVC)
H.265 offers significantly better compression efficiency compared to H.264, making it ideal for high-definition surveillance footage. This codec is especially useful for systems that need to stream and store large amounts of video data without compromising on quality.
The primary difference between H.264 and H.265 lies in their compression efficiency. H.265 offers approximately double the compression efficiency of H.264. However, one of the trade-offs with H.265’s improved compression efficiency is that it requires more processing power to encode and decode. This means that devices and software need to be more powerful to handle H.265 video, which can affect battery life on mobile devices and require more robust hardware for real-time encoding and decoding.
VP8 and VP9
While H.264 and H.265 are widely used, there are also newer and lesser known codecs worth mentioning: VP8 and VP9. However, VP8 and VP9 are not as universally supported as H.264 and H.265, particularly in hardware devices outside of the web ecosystem. Developed by Google, VP8 and VP9 are open and royalty-free compression formats. For more information on Google’s codecs, see here.
Final thoughts
Choosing the right streaming protocol and codec depends on your specific application requirements. To stream video reliably, first identify your needs: What bandwidth is available? How much latency is acceptable? Understanding these factors will guide you in selecting the most suitable protocol and codec, whether it’s SRT for fluctuating networks, RTSP paired with RTP for robust media transmission, or H.264 and H.265 for efficient video compression. Making informed choices ensures high-quality, uninterrupted video streaming tailored to your environment.
If you need help with your streaming protocols, get in touch with us or explore our other resources.
Read our other resources
We’ve published a range of resources for our community, including:
- Guide to WebRTC vs. RTSP Video Streaming Protocols, which compares and contrasts the two leading protocols
- Understanding WebRTC IoT in 2024, which explains the use of WebRTC in the IoT landscape
- Our explainer that covers IoT and the future of video surveillance
