mpeg-ts streaming with Wowza

By | 23/05/2014

When you stream live, you usually take the audio and video signal from a camera or a mixer, you encode it with an external encoder and send the encoded signal to a streaming server like Adobe Media Server or Wowza Streaming Engine. But some cameras have the option to encode the signal and send it as an mpeg-ts stream to a streaming server directly, without using an external encoder. I tested this with a JVC camera and a Wowza 4 server.

In order for this to work, you have to configure an incoming stream on the Wowza server. By default, Wowza is installed in /usr/local/WowzaStreamingEngine folder. Configuration files are in the “conf” subfolder. Open “conf/StartupStreams.xml” file and add the following lines between <StartupStreams> and </StartupStreams>:

<StartupStream>
<Application>live/_definst_</Application>
<MediaCasterType>rtp</MediaCasterType>
<StreamName>live.stream</StreamName>
</StartupStream>

and in the “content” subfolder create the “live.stream” file, with the following content:

udp://0.0.0.0:1234

This will make the Wowza server (after restart) to listen on port 1234 UDP for incoming connections, and when it receives a mpeg-ts stream from an encoder or a camera that can encode the signal, the Wowza server will publish a stream with the name “live.stream” on “live” application (rtmp://wowza-server/live/live.stream).

In order to see this stream in a browser, create a html with this code and load it in the browser:

<html>
<head>
<script src="http://jwpsrv.com/library/SbF1fgEDEeOSZiIACusDuQ.js"></script>
</head>

<body>

<div id='myLive'></div>
<script type='text/javascript'>
    jwplayer('myLive').setup({
        playlist: [{
            sources: [{ 
                 file: 'rtmp://wowza-server/live/live.stream'
            },{
                file: 'http://wowza-server:1935/live/live.stream/playlist.m3u8'
            }]
        }],
        title: 'Test Live',
        width: '640',
        height: '360',
        skin: 'bekle',
        autostart: 'true'
    });
</script>

</body>

</html>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.