Record a stream automatically with a WSE Java module

The LiveStreamRecordAutoRecord module for Wowza Streaming Engine media server software is an alternative to the Record all incoming streams option in Wowza streaming Engine Manager. It enables you to record either all or selected incoming live streams on an application automatically using the default StreamRecorder parameters configured for the application. The recordings are accessible via the Wowza Streaming Engine Manager user interface, the Wowza Streaming Engine REST service, and the LiveStreamRecord HTTP provider.

The module also includes AutoRecordFileVersionDelegate as an alternative to the default file version delegate class.

Contents


Video tutorial
Prerequisites
Installation
Configuration
Properties
Usage
For developers

Video tutorial: Start stream recordings automatically


See how to use the LiveStreamRecordAutoRecord module to automatically record all or specific streams.

Prerequisites


Wowza Streaming Engine™ 4.0.0 or later is required.

Installation


  1. Open the WSE autorecord plugin page on GitHub.
  2. Download the wse-plugin-autorecord-x.x.x.jar file.
  3. Copy the wse-plugin-autorecord-x.x.x.jar file to your WSE instance's [install-dir]/lib directory.
  4. Restart Wowza Streaming Engine.

Configuration


To enable this module, add the following module definition to your application configuration. See Configure modules for details.

Name

Description

Fully Qualified Class Name

ModuleAutoRecord Auto-record streams that are published to this application instance. com.wowza.wms.plugin.ModuleAutoRecord

Properties


After enabling the module, you can adjust the default settings by adding the following properties to your application. See Configure properties for details.

Path

Name

Type

Value

Notes

/Root/Application/StreamRecorder streamRecorderRecordAllStreams Boolean true Start a recorder for every stream that's published to the application instance. This property can be overridden by the streamRecorderRecordType property. (default: true)
/Root/Application/StreamRecorder streamRecorderAutoRecordDebugLog Boolean true Enable debug logging for the module. Debug logging is also enabled for the main StreamRecorder debug logging (streamRecorderDebugEnable) or if logger debugging is enabled. (default: false)

/Root/Application/StreamRecorder streamRecorderRecordType String allow Type of streams to record or how to interpret the streamRecorderStreamNames list. Valid values are:

all - record all streams. Same as streamRecorderRecordAllStreams

source - record all source streams

transcoder - record all transcoder output streams

allow - record streams that match something the names list

deny - record streams that don't match anything the names list

none - don't automatically record any streams

 (default: all)
/Root/Application/StreamRecorder streamRecorderStreamNames String myStream|myOtherStream Pipe (|) or comma separated list of names to match. Can be a single wild card (*), complete names, regex match, wildcard prefix or wildcard suffix. (default: not set)
/Root/Application/StreamRecorder streamRecorderStreamNamesDelimiter String ~ Delimiter chars used to separate the values in streamRecorderStreamNames property. (default: (\\||,) (regex for pipe or comma))

Usage


When the application is started, the module checks to see if the streamRecorderRecordAllStreams property is set to true (default) or if the streamRecorderRecordType property is set to all, and if so, it sets the Stream Recorder Manager to record all of the streams that are published to the application. Alternatively, streams are recorded based on the streamRecorderRecordType setting and if a match is found in the streamRecorderStreamNames list.

Each recorder that's started uses the default StreamRecorder parameters that are configured for the application. These can be set using StreamRecorder properties. For more information, see Record live streams in Wowza Streaming Engine.

You can optionally use the included AutoRecordFileVersionDelegate to include extrapolated String tags in your output file name, such as the RecordingStartTime and SegmentTime. To use the provided custom file naming delegate, set the following StreamRecorder property:

Path

Name

Type

Value

Notes

/Root/Application/StreamRecorder streamRecorderFileVersionDelegate String com.wowza.wms.plugin.AutoRecordFileVersionDelegate Fully qualified class name of the file version delegate used to name recorded files. Set to com.wowza.wms.plugin.AutoRecordFileVersionDelegate to use the streamRecorderFileVersionTemplate and streamRecorderFileVersionDateTimeFormat properties.







The following properties can be used with this module. See Configure properties for details.

Path

Name

Type

Value

Notes

/Root/Application/StreamRecorder streamRecorderFileVersionTemplate String ${SourceStreamName}_${RecordingStartTime}_${SegmentNumber} Output file name. Supports extrapolated tags: ${SourceStreamName}, ${BaseFileName}, ${SegmentNumber}, ${RecordingStartTime}, ${SegmentTime}. Requires configuration of the streamRecorderFileVersionDelegate property. (default: ${SourceStreamName}_${RecordingStartTime}_${SegmentNumber})
/Root/Application/StreamRecorder streamRecorderFileVersionDateTimeFormat String MMddyyyy Java DateTimeFormatter pattern used for ${RecordingStartTime} and ${SegmentTime}. Requires configuration of the streamRecorderFileVersionDelegate property. (default: yyyy-MM-dd-HH.mm.ss.SSS-z)



For developers


  • Get the source code on GitHub