The following configuartion will add a server listener that will monitor an applications content folder for added and deleted .sdp and .stream files. When a new file is detected, the stream manager will be used to start the stream. When a file is removed the stream manager will be used to stop the stream. Below is the configuration.
First, install this patch or newer build or patch: WowzaMediaServer2.1.2-patch1.zip
Setup your application for live streaming following one of these tutorials:
RTMP, RTSP/RTP:
http://www.wowzamedia.com/forums/showthread.php?t=6467
MPEG-TS:
http://www.wowzamedia.com/forums/showthread.php?t=6468
Native RTP (SDP file):
http://www.wowzamedia.com/forums/showthread.php?t=6469
IP Camera (RTSP/RTP re-streaming):
http://www.wowzamedia.com/forums/showthread.php?t=6470
Next:
- Edit [install-dir]/conf/Server.xml and make the following changes:
- Added the following <ServerListener> to the <ServerListeners> list:
Code:<ServerListener> <BaseClass>com.wowza.wms.serverlistener.ServerListenerStartupStreamsMonitor</BaseClass> </ServerListener>- Add the following properties to the <Properties> container at the bottom of the file:
Note: Modify the properties as needed for your streaming setup.Code:<!-- Pipe (|) delimited list of application names for which to monitor: [vhostName]:[application]/[appInstance] --> <!-- This can be shorted to [application] assuming using _defaultVHost_ and _definst_ as the vhost and appInstance names --> <Property> <Name>startupStreamsMonitorApplicationList</Name> <Value>live</Value> </Property> <!-- Stream prefix. Valid values are: flv and mp4 --> <Property> <Name>startupStreamsMonitorStreamPrefix</Name> <Value>mp4</Value> </Property> <!-- MediaCaster type. Valid values are: rtp, rtp-record, shoutcast, shoutcast-record, liverepeater --> <Property> <Name>startupStreamsMonitorMediaCasterType</Name> <Value>rtp</Value> </Property> <!-- Pipe (|) delimited list of file extensions for which to search --> <Property> <Name>startupStreamsMonitorExtensionFilter</Name> <Value>.stream|.sdp</Value> </Property>
- Edit [install-dir]/conf/live/Application.xml and make the following changes:
- Create a non-shared content folder for the live application by setting the Streams/StorageDir as follows:
Code:<StorageDir>${com.wowza.wms.context.VHostConfigHome}/applications/${com.wowza.wms.context.Application}/content</StorageDir>- Add the following properties to the <Properties> container at the bottom of the Application.xml file (be sure to get the correct <Properties> container - there are several in the file):
Note: Modify the properties as needed for your streaming setup.Code:<!-- Stream prefix. Valid values are: flv and mp4 --> <Property> <Name>startupStreamsMonitorStreamPrefix</Name> <Value>mp4</Value> </Property> <!-- MediaCaster type. Valid values are: rtp, rtp-record, shoutcast, shoutcast-record, liverepeater --> <Property> <Name>startupStreamsMonitorMediaCasterType</Name> <Value>rtp</Value> </Property> <!-- Pipe delimited list of file extensions for which to search --> <Property> <Name>startupStreamsMonitorExtensionFilter</Name> <Value>.stream|.sdp</Value> </Property>
Note: The values specified here will override the values specified in [install-dir]/conf/Server.xml.
- Create the folder [install-dir]/applications/live/content. This folder is the folder that will be monitored for new .sdp and .stream files.
- Start Wowza Media Server
With this in place streams will automatically be started and stopped as .stream and .sdp files are added and removed from the [install-dir]/applications/live/content folder.
Note: This system can monitor more than one application at a time. Set the startupStreamsMonitorApplicationList to a pipe (|) delimited list of application for which you would like monitoring to occur. For example to monitor the applications live1 and live2 set startupStreamsMonitorApplicationList as follows:
Code:<Property> <Name>startupStreamsMonitorApplicationList</Name> <Value>live1|live2</Value> </Property>
Note: The application instances that are being monitored will be loaded and will not be unloaded. This is so the stream monitor can continue to start and stop streams while the Wowza Media Server is running.
Charlie


Reply With Quote