Generated by spec.rb at: 2012-09-17 20:07:50 +0200

StreamSwitch module

Table of contents

What's this

This WMS 3.X module allows you to switch live stream(s) between two live source streams.

It is designed to run on either live or liverepeater-origin application.

Installation

Add wejn-streamswitch.jar to Wowza's lib/ directory.

Add following to Modules section of your Application.xml:

<Module>
	<Name>streamswitch</Name>
	<Description>switch between stream sources</Description>
	<Class>cz.wejn.wowza.streamswitch.StreamSwitch</Class>
</Module>

Add following to Properties section of your Application.xml (adjust parameters as needed):

<Property>
    <Name>StreamSwitchStartFaking</Name>
    <Value>true</Value>
</Property>
<Property>
    <Name>StreamSwitchDef0</Name>
    <Value>mbp1ss|mbp_1|fakestream</Value>
</Property>
<Property>
    <Name>StreamSwitchDef1</Name>
    <Value>mbp2ss|mbp_2|fakestream</Value>
</Property>
<Property>
    <Name>StreamSwitchDef2</Name>
    <Value>mbp3ss|mbp_3|fakestream</Value>
</Property>
<!--
You can add as many StreamSwitchDef# properties as you like, provided
they are numbered in continuous sequence, starting with 0.

Therefore the following definition will be ignored by StreamSwitch
(as there is no StreamSwitchDef3):
 -->
<Property>
    <Name>StreamSwitchDef4</Name>
    <Value>mbp4ss|mbp_4|fakestream</Value>
</Property>

The abovementioned setup would publish three streams:

Restart Wowza to finish installation.

Configuration options

StreamSwitchStartFaking

Boolean, default false.

This option controls whether to start with fake source or real source after application spin-up.

StreamSwitchDef# (multiple, numbered)

String.

This is definition of single stream switch. It is in format: switched_stream_name|real_source|fake_source.

As explained in the example, this module accepts multiple properties differentiated by stream number. Numbering starts from zero (0) and must be continuous, with no gaps. The module stops looking for additional definitions as soon as it reaches first gap. Thus any definitions after any gap will be ignored.

JMX interface

Module publishes two attributes and two operations.

Attribute: numberOfStreams

Shows number of streams loaded.

Attribute: amIFaking

Shows whether the resulting stream(s) are switched to fake (true) or real (false) source.

Operation: switchStreamToReal

Switches stream source to real source on all defined streams.

Returns either ok or any errors encountered when switching.

Operation: switchStreamToFake

Switches stream source to fake source on all defined streams.

Returns either ok or any errors encountered when switching.

License

Copyright (c) 2012 Michal "Wejn" Jirku <box@wejn.org>

This work is licensed under the Creative Commons Attribution 3.0 Czech Republic License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/cz/.