Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Overview

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

Supported protocols:

  • WebRTC
  • RTMP
  • RTSP

Recording formats:

  • 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


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


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

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:

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:

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:

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:

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