• How to start streams at server startup

    Wowza Streaming Engine™ live streaming software can be configured to automatically re-stream live streams when you start your Wowza media server. These startup streams use the MediaCaster system to re-stream IP camera streams (RTSP/RTP streams), SHOUTcast/Icecast audio streams, and streams from native RTP or MPEG-TS encoders. When the server starts, the MediaCaster system pulls streams from these sources automatically and makes them available for streaming to all player technologies supported by the server.

    Contents


    Configure and publish a stream to a live application
    Add a stream to the Startup Stream list


    Configure and publish a stream to a live application

    Before adding MediaCaster streams to the Startup Streams list, make sure you have already set up your live application and published a stream that will be used as a startup stream. For more information, follow the tutorial that corresponds to your stream type:

    How to set up live streaming using an RTSP/RTP-based encoder
    How to re-stream audio from SHOUTcast/Icecast
    How to configure a live stream repeater

    Add a stream to the Startup Stream list


    Wowza Streaming Engine Manager configuration

    To configure a startup stream:

    1. In Wowza Streaming Engine Manager, click the Server tab.

    2. Click Startup Streams, and then click Add Startup Stream.



    3. In the Add to Startup Streams dialog box, add the following information:

      • In Stream Name, enter the name of the live stream (for example, myStream).

      • In Application Name, select the name of a live application (for example, live) that's configured in the Wowza Streaming Engine server and contains the stream. This application will be used to re-stream the startup stream.

      • For Application Instance select Connect to default application instance: _definst_ or specify an alternate application instance to use for re-streaming. The application instance is created if it doesn't exist.

      • For MediaCaster Type, select the MediaCaster type in the list that corresponds to the stream type:

        • Select rtp for IP camera streams (RTSP/RTP streams) and for streams from native RTP and MPEG-TS encoders.

        • Select shoutcast for SHOUTcast/Icecast streams.

        • Select liverepeater if the stream is pulled from another Wowza media server.

        • Select rtp-record or shoutcast-record to re-stream and record the stream to a single file in the application's streaming file directory. If the source starts and stops, the file is versioned with a version number and a new file is started.

        Note: If you use the rtp-record or shoutcast-record MediaCaster types, you can control the container format used (MP4 or FLV) by specifying a stream name prefix in the source. If you specify the mp4: prefix, the stream is recorded to an MP4 (QuickTime) container. An MP4 container can only record H.264, AAC, and MP3 media data. If you specify the flv: prefix, the stream is recorded to an FLV container. The FLV container is the only option if you're recording with Flash Player. To apply advanced recording capabilities to these streams, you can use the Incoming Streams feature in Wowza Streaming Engine software instead.

    4. Click OK and then restart the Wowza media server to start the stream.



    XML configuration

    Note: If you configured your application in Wowza Streaming Engine Manager (as described in the previous section), skip this section. Wowza Media Server™ software doesn't support Wowza Streaming Engine Manager, so you must edit StartupStreams.xml in a text editor. If you're using Wowza Streaming Engine software and you make changes to StartupStreams.xml, any supported settings are displayed in the manager the next time it's started.
    To configure a startup stream:

    1. Use a text editor to open the [install-dir]/conf/StartupStreams.xml file and add a <StartupStream> entry for each stream you want to have started at server startup. Here are a few examples:

      RTSP/RTP example (RTSP URL is rtsp://192.168.1.7:554/mycoolstream.sdp):
      <StartupStream>
      	<Application>live/_definst_</Application>
      	<MediaCasterType>rtp</MediaCasterType>
      	<StreamName>rtsp://192.168.1.7:554/mycoolstream.sdp</StreamName>
      </StartupStream>
      Native RTP example (SDP file is myStream.sdp):
      <StartupStream>
      	<Application>live/_definst_</Application>
      	<MediaCasterType>rtp</MediaCasterType>
      	<StreamName>myStream.sdp</StreamName>
      </StartupStream>
      Using a .stream file to simplify a MPEG-TS stream URL (mpegts.stream is a text file containing udp://0.0.0.0:10000):
      <StartupStream>
      	<Application>live/_definst_</Application>
      	<MediaCasterType>rtp</MediaCasterType>
      	<StreamName>mpegts.stream</StreamName>
      </StartupStream>
      SHOUTcast example (using the radiostation.stream .stream file containing http://197.45.161:8024 as the SHOUTcast URL):
      <StartupStream>
      	<Application>live/_definst_</Application>
      	<MediaCasterType>shoutcast</MediaCasterType>
      	<StreamName>radiostation.stream</StreamName>
      </StartupStream>
      Note: <StreamName> property values in StartupStreams.xml can be a .stream file name, stream URI, or properly mapped domain.
      You can enter the following values in the <MediaCasterType> property:

      • rtp: For IP camera streams (RTSP/RTP streams) and for streams from native RTP and MPEG-TS encoders.

      • shoutcast: For SHOUTcast/Icecast streams.

      • liverepeater: For streams that are pulled from another Wowza media server.

      • rtp-record or shoutcast-record: To re-stream and record the stream to a single file in the application's streaming file directory. If the source starts and stops, the file is versioned with a version number and a new file is started.

      Note: If you use the rtp-record or shoutcast-record MediaCaster types, you can control the container format used (MP4 or FLV) by specifying a stream name prefix in the source. If you specify the mp4: prefix, the stream is recorded to an MP4 (QuickTime) container. An MP4 container can only record H.264, AAC, and MP3 media data. If you specify the flv: prefix, the stream is recorded to an FLV container. The FLV container is the only option if you're recording with Flash Player.
    2. Restart the Wowza media server software to apply the changes.


    Originally Published: 10-01-2010.
    Updated: For Wowza Streaming Engine 4.0.6 on 08-11-2014.

    If you're having problems or want to discuss this article, post in our forum.