SRT

January 4, 2023 ยท 2 minute read

Last time we touched RTMP, now let’s talk about SRT.

SRT (Secure Reliable Transport) and Zixi are both protocols that are designed for low-latency, high-quality video streaming over the internet. Both protocols are designed to overcome the challenges of streaming over unpredictable networks and provide a reliable and secure way to transmit video content.

SRT is an open-source protocol that was developed by Haivision and is now managed by the SRT Alliance. SRT is designed to be lightweight and efficient, and it uses a variety of techniques to overcome the challenges of streaming over unpredictable networks.

Zixi is a proprietary protocol that was developed by Zixi LLC. Like SRT, Zixi is designed to provide low-latency streaming over unpredictable networks. Some of the key features of Zixi include:

Some of the key features of these protocols are

  • Low latency: Both SRT and Zixi are designed to provide low-latency streaming, which is essential for live events and other applications that require real-time interactions.
  • Forward error correction: They use forward error correction (FEC) to ensure that video packets are delivered to the viewer even if some packets are lost in transit.
  • Encryption: There’s built-in support for AES encryption, which helps to protect video content from being intercepted or tampered with.
  • Adaptive bitrate: ABR is used to automatically adjust the video bitrate to match the available network bandwidth.

We heard about ffmpeg already in the last post. It is a free, open-source command-line tool that can also be used to generate SRT streams. Actually, it is more of a Swiss army knive for video stuff. You can use the following command to start streaming:

ffmpeg -i [input_file] -c:v libx264 -c:a aac -f srt srt://[server_url]:[port]?pkt_size=1316

In this command, input_file is the path to the video file or device you want to stream, server_url is the address of the SRT server, and port is the port number. The -c:v libx264 and -c:a aac options again specify the codecs to be used for the video and audio - just like in the RTMP example. The -f srt option tells ffmpeg to output the stream in SRT format.

Cheers.