Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

A media stream captured by WCS can be recorded during publishing.

...

  • MP4 for H.264 + AAC codecs
  • WebM for VP8 + Vorbis codecs

Quick manual on testing

Stream recording

1. For this test we use the demo server at demo.flashphoner.com and the Stream Recording web application

https://demo.flashphoner.com/client2/examples/demo/streaming/stream_recording/recording.html

Image Added


2. Click the "Start" button. Capturing and publishing of the stream starts.

Image Added


3. Click the "Stop" button. Broadcasting stops, and a link to play and download the recorded fragment appears.

Image Added

Configuration

Server side

By default, stream recording is turned off on the WCS server.
To turn recording off add the following line to the config /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties:

Code Block
languagebash
themeRDark
record_streams=false

The on_record_hook_script setting points to the shell-script in the /usr/local/FlashphonerWebCallServer/bin directory that is invoked when stream recording finishes.

By default:

Code Block
languagebash
themeRDark
on_record_hook_script=on_record_hook.sh

This script can be used to copy or move the stream record from the WCS_HOME/records directory to another location after recording completes.

Example:

Code Block
languagebash
themeRDark
STREAM_NAME=$1
SRC_FILE=$2
SRC_DIR="/usr/local/FlashphonerWebCallServer/records/"
REPLACE_STR="/var/www/html/stream_records/$STREAM_NAME-"
DST_FILE="${SRC_FILE/$SRC_DIR/$REPLACE_STR}"
cp $SRC_FILE $DST_FILE

Here

  • $1 - stream name
  • $2 - absolute path and file name of the stream record
  • when stream recording ends, the record file is copied to /var/www/html/stream_records/

Client side

If stream recording is enabled on the server, whether the stream is recorded or not is determined by the value of record parameter passed into the createStream function in the script of the publisher client:

  • true - the stream published by this client is recorded;
  • false - the stream is not recorded.

For instance, the script of the Stream Recording application recording.html, recording.js, contains the following code:

Code Block
languagejs
themeRDark
function publishStream(session) {
    var streamName = $('#url').val().split('/')[3];
    session.createStream({
        name: streamName,
        display: localVideo,
        record: true,
        receiveVideo: false,
        receiveAudio: false
        ...
    }).publish();
}