Wowza Streaming Engine™ media server software can be configured to automatically re-stream live streams when you start the 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.
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:
- Set up live streaming using an RTSP/RTP-based encoder in Wowza Streaming Engine
- Re-stream audio from SHOUTcast/Icecast in Wowza Streaming Engine
- Configure a live stream repeater in Wowza Streaming Engine
Add a stream to the Startup Streams list
Wowza Streaming Engine Manager configuration
To configure a startup stream:
- In Wowza Streaming Engine Manager, click the Server tab.
- Click Startup Streams, and then click Add Startup Stream.
- 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 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 Streaming Engine 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.
- Select rtp for IP camera streams (RTSP/RTP streams) and for streams from native RTP and MPEG-TS encoders.
- In Stream Name, enter the name of the live stream (for example, myStream).
- Click OK and then restart Wowza Streaming Engine.
XML configuration
Note: If you configured your application in Wowza Streaming Engine Manager (as described in the previous task), skip this task. If you make changes to StartupStreams.xml, any supported settings are displayed in Wowza Streaming Engine Manager the next time it starts.
To configure a startup stream:
- 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>myApplication/_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>myApplication/_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>myApplication/_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>myApplication/_definst_</Application> <MediaCasterType>shoutcast</MediaCasterType> <StreamName>radiostation.stream</StreamName> </StartupStream>
Note: The <StreamName> value in StartupStreams.xml can be a .stream file name, a stream URI, or a 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 Streaming Engine 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.
- Restart Wowza Streaming Engine to apply the changes.
Specify a delay between streams
To help reduce CPU load when starting multiple streams, insert a delay between them. Specify the delay by adding the startupStreamsDelayTime property to VHost.xml, which is located in [install-dir]/conf/. Insert startupStreamsDelayTime in the <VHost>/<Properties> section as follows:
<Property> <Name>startupStreamsDelayTime</Name> <Value>3000</Value> <Type>Integer</Type> </Property>
The value is in milliseconds, so 3000 inserts a three-second delay between startup streams.