Publish SRT stream to Wowza

2020-05-30 20:34:00

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. The network firewall should also allow incoming UDP.

2. Create .stream file via Wowza Streaming Engine Manager. In our sample the name of the will 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. Our live encoder will stream SRT to Wowza server (push the stream). In case when Wowza server should pull the stream from encoder IP and port of the encoder should be set in URI

3. Start to receive stream on live application with MediaCaster type set to srt.


4. Runn live encoder to publish the stream. In our sample this will be ffmpeg to stream MP4 file in the 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 Live encoder like OBS broadcaster or vMix could be used for SRT publishing as well.

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 the encoder.