Recently, SRT video streaming technology has become increasingly popular. In this article, we will not go into the features of the protocol itself, much less compare it with the RTMP protocol. Note only that SRT was initially positioned primarily as an alternative to services (very expensive) such as Zixi, which allow Mpeg2 transport stream to be transmitted over the open Internet, with minimal loss of quality and minimum possible delay (given the fact that retransmission of lost packets is always an additional delay). Accordingly, it was proposed for use where the source signal was originated by professional TV equipment in the first place. Next, very often, the SRT protocol began to be seen as a revolutionary replacement for the abandoned Adobe RTMP protocol for all cases of streaming on the Internet. Although on a stream with a small bitrate and streamer located in the same geographic region as the receiving server, no one will notice any differences in the quality of the broadcast when using one or another protocol.
Let's focus on SRT support in the Wowza Streaming Engine. The Wowza media server can act as both an SRT transmitter and as SRT trafic receiving end point. The most interest for a wide range of users is just the second scenario and configuring it in Wowza is extremely simple:
1. On the server where Wowza is installed, the firewall must be configured to allow incoming UDP traffic. Preferably a range of ports should be allowed since each SRT stream will require it's own UDP port number to be assigned. The network firewall should also allow incoming UDP.
2. Create .stream file via Wowza Streaming Engine Manager. In our example the name of the file will be srt.stream. URI should be set as srt://0.0.0.0:10000 , this will instruct Wowza to listen for stream on local network interface , UDP port 10000. The encoder will publish the SRT stream to Wowza server in push mode, or in SRT terminology, the encoder will work in Caller mode.1
3. Start to receive stream on live application with MediaCaster type set to srt.
4. Run live encoder to publish the stream. In our case this will be ffmpeg to stream MP4 file in a loop:
ffmpeg -re -stream_loop -1 -i sample.mp4 -pix_fmt yuv420p -deinterlace -vf "scale=640:360" -vsync 1 -threads 0 -vcodec libx264 -r 29.970 -g 60 -sc_threshold 0 -b:v 1024k -bufsize 1216k -maxrate 1280k -preset medium -profile:v main -tune film -acodec aac -b:a 128k -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -vbsf h264_mp4toannexb -f mpegts srt://xxx.xxx.xxx.xxx:10000
Where xxx.xxx.xxx.xxx is the IP address of Wowza server. Please note that if there are several IPs on one network interface, Wowza can only receive SRT stream on the first of the IP addresses.
Instead of ffmpeg, you can use OBS Studio, vMix, or any other SRT enabled encoder for publishing.
5. Check for incoming stream bitrate indication
6. Play HLS stream from Wowza server: ffplay http://xxx.xxx.xxx.xxx:1935/live/srt.stream/playlist.m3u8
7. Add the stream to auto start list Startup Streams), else it will be not connected upon Wowza service restart.
An important difference between the SRT publishing process and the RTMP is that the stream must first be created in the Wowza Manager management interface (stream file) and be started on the server (connected). While for RTMP publishing it is not necessary to create anything - the stream on the Wowza server is created upon publication by RTMP encoder.
1. Wowza server is also capable to pull stream from SRT encoder running in the Listner mode. In this case, the URI is set to IP and port on the encoder. But Rendezvous mode of SRT devices interaction is not supported by Wowza.