• How to start streams at server startup (StartupStreams.xml)

    Wowza Media Server includes a feature for configuring streams that are publish/started at server startup. This is the equivalent of starting a streaming using the MediaCaster Stream Manager. To configure a stream to start at server startup do the following:

    1. Edit [install-dir]/conf/StartupStreams.xml and add a <StartupStream> entry for each stream you wish 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):
      Code:
      <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):
      Code:
      <StartupStream>
      	<Application>live/_definst_</Application>
      	<MediaCasterType>rtp</MediaCasterType>
      	<StreamName>myStream.sdp</StreamName>
      </StartupStream>
      SHOUTcast example (SHOUTcast URL is http://mycompany.com/station1):
      Code:
      <StartupStream>
      	<Application>live/_definst_</Application>
      	<MediaCasterType>shoutcast</MediaCasterType>
      	<StreamName>http://mycompany.com/station1</StreamName>
      </StartupStream>
      Using a .stream file to simplify MPEG-TS stream (myStream.stream is text file with contents udp://0.0.0.0:10000):
      Code:
      <StartupStream>
      	<Application>live/_definst_</Application>
      	<MediaCasterType>rtp</MediaCasterType>
      	<StreamName>myStream.stream</StreamName>
      </StartupStream>
    2. Start Wowza Media Server



    Comments 11 Comments
    1. toti171 -
      Can I use?

      <StreamName>http://primary.server/stream|http://backup.server/stream</StreamName>

      If yes, how is the logic of going to backup server?
    1. randall -
      Hi toti171,

      Those stream URIs don't seem valid. See the QuickStartGuide for examples. Also see the Live Repeater Quickstart if you are trying to do an Origin-Edge configuration.
    1. toti171 -
      I´m sorry.. I wasn´t clear

      What I want to do, is have the signal started on server boot, but with a backup server in case of some unavailability.

      <StreamName>rtmp://[wowza-origin-address]:1935/liveorigin|rtmp://[wowza-alternate-origin-address]:1935/backuporigin</StreamName>

      Thanks
    1. rrlanham -
      You can do that with the Wowza liverepeater by include a pipe separated string just like you have in the Application.xml /originURL

      Another method is to use .stream files or StreamNameAlias alias and have pipe separated origin stream URLs that include the stream name, like this:

      File: /content/origin.stream
      Contents: rtmp://[wowza-origin-address]:1935/liveorigin/myStream|rtmp://[wowza-alternate-origin-address]:1935/backuporigin/myStream

      Richard
    1. vu duc -
      Hi all,

      I have a question:
      If I have many .stream file in some folders, like this:
      File1: /content/a/a1.stream
      File2: /content/a/a2.stream
      File3: /content/a/a3.stream
      File4: /content/b/b1.stream
      File5: /content/b/b2.stream
      File6: /content/b/b3.stream
      ...

      I want to publish all, what can I do?
      Thanks!
    1. rrlanham -
      Use /conf/StartUpStreams.xml, which is linked at top of this thread
      http://www.wowzamedia.com/forums/con...upStreams.xml)

      This will start stream on startup. If you want to do at another time, all at once, you can use the MediaCaster API
      http://www.wowza.com/forums/content....PEG-TS-streams

      Richard
    1. vu duc -
      Thank Richard,

      I use /conf/StartUpStreams.xml to publish 32 .stream files.
      Firstly, everything works fine, but after java crashes with the exception :"java.lang.OutofMemeory Error: Java heap space"

      Can you help me,
      Thanks,
    1. rrlanham -
      Make sure you are properly tuned:
      http://www.wowza.com/forums/content....ormance-tuning

      The limiting factor for incoming streams is ram and cpu (for outgoing streams the usual limiting factor is bandwidth). To handle 32 streams you should have a late model quad or dual quad cpu, 4 - 8g ram, 64bit OS and 64bit Java latest JDK.

      Richard
    1. vu duc -
      Thank you so much, Richard!

      I have another question:
      I want to publish 10 HD channels (8bitrates/ channel) and using origin-edge application (1 origin server and 2 edge servers).But my origin server is not enough ram and cpu. If I use many origin, one origin for some different channels, does it work?

      Thanks,
    1. rrlanham -
      You can have as many origin servers as you want. An edge server can re-stream from many sources by using .stream files on edge servers to refer to origin streams. This technique ignores the Application.xml /originURL setting. Take a look at this guide:

      http://www.wowza.com/forums/content....tream-repeater

      Richard
    1. vu duc -
      Thank Richard for your reply !