NitroXy Media's module for Wowza.
- Stream switching
- Remote control via json (and website for doing that)
-
Download jar or build module yourself (see build instructions below)
-
Put jar in
/usr/local/WowzaStreamingEngine/lib
. -
In
/usr/local/WowzaStreamingEngine/conf/Server.xml
add aServerListener
:<ServerListener> <BaseClass>com.nitroxy.wmz.module.ServerListener</BaseClass> </ServerListener>
-
In
/usr/local/WowzaStreamingEngine/conf/VHost.xml
add aHTTPProvider
in the Admin section:<HTTPProvider> <BaseClass>com.nitroxy.wmz.module.RESTProvider</BaseClass> <RequestFilters>nitroxy*</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider>
-
In
/usr/local/WowzaStreamingEngine/conf/$application/Application.xml
add the module:<Module> <Name>NitroXyModule</Name> <Description>NitroXy stream control module</Description> <Class>com.nitroxy.wmz.module.NitroXyModule</Class> </Module>
-
Configure webserver to serve the content under
wowza_nx_control
and to proxy/api
tolocalhost:8086/nitroxy
Seeansible/ngigx.conf
for an example of how this can be setup.
The recommended and easiest way is to use Vagrant.
vagrant up
ant
- (Optional) If you need to test changes you need to restart the service:
vagrant ssh
followed bysudo service WowzaStreamingEngine restart
- Install Wowza.
- Install Eclipse and Wowza IDE
- Put the repo in a folder called NitroxyWowzaModule (case sensitive due to the way wowza builds modules)
- Add a new "Wowza Media Server Java Project" with these settings:
Project name: NitroxyWowzaModule
Wowza location: /usr/local/WowzaStreamingEngine
Package: com.nitroxy.wmz.module
Name: NitroXyModule - Also ensure the java compatibility level is at least 1.6 (it is stored both globally for eclipse and per project)
Parameters is preferably passed as application/json
in the POST body.
All responses are wrapped in the following wrapper:
{
"status": "success" | "error",
"data": ...
}
For errors error
and stacktrace
is present and data
may not be present.
Fetches list of available stream sources, both live and VOD.
returns:
[NAME...]
Fetches current system status.
returns:
{
"enabled": BOOLEAN,
"live_target": STREAM,
"preview_target", STREAM,
"fallback_target", STREAM,
"is_published", BOOLEAN,
"segment": {
"started_at": TIMESTAMP,
"duration": SECONDS
}
}
If enabled
is false no other fields is present and means that the module is disabled on the server.
Changes the source stream of the preview target.
parameters:
{
stream: NAME
}
Changes the source stream of the live target to match the preview target.
Changes the fallback stream (the stream switched to when the real stream goes down).
parameters:
{
stream: NAME
}
Restarts all streams and publishing.
Stops all streams and publishing.
Enable/disable automatic stream recording.
parameters:
{
state: BOOLEAN,
}
Instructs the stream recorder to finalize and move to a new segment.
Start/stops external publishing (e.g. to twitch)
parameters:
{
state: BOOLEAN
}
REST API is now enabled by adding a HTTPProvider under 'VHost.xml`:
<HTTPProvider>
<BaseClass>com.nitroxy.wmz.module.RESTProvider</BaseClass>
<RequestFilters>nitroxy*</RequestFilters>
<AuthenticationMethod>none</AuthenticationMethod>
</HTTPProvider>