You can record an RTC session as individual streams and also get it transcoded through a post-session service to create a single composite video file that can be retrieved and replayed using any Video Player. You can configure the Room for auto-recording or invoke APIs to start recording when required.

Table of Contents

Ways to Record

Auto-Recording

You can configure a Room with { settings: { auto_recording: true }} during Room Creation to automatically start recording the RTC session taking place in the Room. The Moderator can still stop recording in a Room with Auto-Recording by utilizing the stopRecord() method.

On-Demand Recording

The EnxRoom.startRecord() method allows the Moderator to start recording the session and EnxRoom.stopRecord() method is used to stop recording. You can use these to provide options on UI for the Moderator to access them.

There is no limit to the number of times a Moderator can start/stop recording.

Methods:

  • EnxRoom.startRecord(Callback)
  • EnxRoom.stopRecord(Callback) 

Event Notifications:

  • room-record-on – Notification to all the participants in the Room along with Moderator ID when the recording is turned on.
  • room-record-off – Notification to all the participants in the Room along with Moderator ID when the recording is turned off.
// To start recording
room.startRecord( function( result, error ) {
     if (result == 0) {
         // Recording started
     } 
});
 
// To stop recording
room.stopRecord( function( result, error ) {
     if (result == 0){
         // Recording stopped
     }  
});

// Notification recording started to all
room.addEventListener( "room-record-on", function(event) {
     // Recording started, Update UI
     // event.message.moderatorId = Moderator who stated recording.
}); 
    
// Notification recording stopped to all
room.addEventListener( "room-record-off", function(event) {
     // Recording stopped, Update UI
     // event.message.moderatorId = Moderator who stopped recording. 
});

Watermarking

You may now watermark your recorded files with a Image File uploaded through your Portal againt your Project. Transcoded files will only be watermarked.

Follow these 2 points to get transcoded files watermarked.

Provision for a Watermark Files

Upload the watermark file against your project. Follow this path:

Portal Login > Video >  Settings > Recording > Watermarking

  • Image Format: PNG
  • Image Dimension: 140×140 px (Maximum)

Enable Room for Watermarking

You need to define your room to enable Watermarkign in it. Use setting.watermark=true while.

{	"name": "My room",
	"owner_ref": "XOXO",
	"settings": {
		"watermark": true
	}
}

Get Recording Files

Type of Recording Files

The following type of files you get in the recording process:

  1. Individual Participants Stream Recordings: Each users stream gets recorded individually and are made available for download. These files are in .MKV format.
  2. Transcoded Re-playable Session:  It’s a single composite video file created out of all the individual participant’s streams in the right playtime. These files are created in .MP4 format. Transcoding is a subscription based service. The Transcoded files are made available for download. If moderator has recorded different segment of Video Session, you get multiple .MP4 files, one for each recorded segments. Transcoding is done in a predefined layout.

Note: Individual Stream Recordings are available for download within minutes post session. However, transcoding process to create single playable file takes longer to finish. Therefore, transcoding files may be available for download within 10-45 minutes post session depending on transcoding queue.

Use Server API to get Files

Using Server API you can fetch Archive Reports through a HTTP GET request to its archive route. You may use the following filters to get the right set of Archive Report as designed:

  • For a Period – For a given From and To date
  • For a Room ID
  • For a Room ID within a Period
  • For a specific Session – For a given Conference Number

After getting the Archive Report, you may need to do HTTP GET to each of the URLs given in the Report to download files individually.

Please refer to online documentation for detailed explanation of API calls.

Get Files delivered

EnableX delivers your files your location / server / storage using its Archive Delivery Service. You need to configure your Delivery Loation using Portal.

Portal Login > Video >  Settings > Archive

Using this Tool, define your Delivery Server with Access Credentials. EnableX supports delivery to the following location:

  • FTP / SFTP to your Server
  • SCP to your Server
  • Amazon S3
  • Azure Blob Storage
  • Google Drive

Once configured, EnableX transfers your files and keep them organized in sub-folders in the folder you designated for delivery.

File delivery is a batch process. You may face significant delay in delivery. After a file is delivered to your location, EnableX notifies you through a Webhook Notification to help you automate workflow.

Get notified through Webhook

EnableX may notify you as soon as any file is available for downloading or as soon as a file gets delivered to your location by HTTP POST to a designated Webhook URL. You need to setup the URL at your Project Server. To configure your Webhook URL, follow the path:

Portal Login > Video >  Settings > Preferences > Webhook

Once configured, EnableX does HTTP POST with JSON Raw Body to the URL for you to process. Note that you need to do HTTP GET to each of the URLs given in the JSON to download files individually. JSON Format given below:

// When a Recording files are ready 
{	
	“type”: “recording”,
	“trans_date”: “Datetime”,  /* In UTC */
	“app_id”: “String”,
	“room_id”: “String”,
	“conf_num”: “String”,
	“recording”: [ 
		{ "url": "http://FQDN/path/file" }
	]
}

// When Transcoded Video files is ready
{	
	“type”: “transcoded”,
	“trans_date”: “Datetime”,  /* In UTC */
	“app_id”: “String”,
	“room_id”: “String”,
	“conf_num”: “String”,
	“transcoded”: [ 
		{ "url": "http://FQDN/path/file" }
	]
}

// When Chat Scripts are ready 
{
	“type”: “chatdata”,
	“trans_date”: “Datetime”,  /* In UTC */
	“app_id”: “String”,
	“room_id”: “String”,
	“conf_num”: “String”,
	“chatdata”: [ 
		{ "url": "http://FQDN/path/file" }
	]
}

Please refer to online documentation for detailed explanation of Webhook Notification.

New Way to Record Live with an UI

Availabiity: v2.1.2+

Recording Live refers to a new process of creating a transcoded file in a live session with a custom layout without having to record individual streams. So, using Live Recording has double advantage:

  • You get a transcoded file within minutes post session. Not to wait longer alike previous transcoding process.
  • You have an option to define your own layout for the live recording process unlike previous transcoding process that creates in a predefined layout.

Auto Live Recording

You can configure a Room with to start Live Recording automatically as soon as the first person joing the Room. This may be done while creating a Room with the following settings:

"settings": { 
	"live_recording": {
		"auto_recording: true, 
		"url": "https://your-custom-view-url"
	}
}

Moderator can still stop live recording in a Room by using the stopRecord() method given below.

On-Demand Live Recording

Using SDK methods, a Moderator can start / stop live recording any time as he demands. The EnxRoom.startLiveRecording() method allows the Moderator to start live recording the session and EnxRoom.stopLiveRecording() stops it.

Start Live Recording

Class: EnxRoom

MethodEnxRoom.startLiveRecording(config, callback) – to start live recording.

Parameters:

  • config– Recording configuration. Its a JSON object with following keys:
    • urlDetails – Its a JSON Object to define Custom View and its options.
      • url – To specify the URL of custom view. (Know how to create Custom View for Live Recording. Its the same way as we create View for Live Streaming)
      • any_custom_key_object – You may use any custom key or object that the your Custom View handles to change view/layout etc through query string.
  • callback – The Callback method

Event Notifications:

  • room-live-recording-on – Notification to all users when Live Recording gets started. A new user joining the session gets the same notification if the session is being recorded live.

Response Body:

{
	data = {
		status =  {
			resultCode = 0,
                        success = true,
                        error = {
				errorCode = 0;
                                errorDesc = "";
			} 
		},
		startedBy = "7f0f2b04-1ad4-4231-8fdc-9f9e014053b4",
	},
        type = "room-live-recording-on";
}
  • room-live-recording-failed – Notification to the moderator who tried to start Live Recording when recording fails.
var myRecordConfig={}; 
myRecordConfig.urlDetails = {
	"url": "url",
	"layOut": {},
	"chatOverlay": false
};

 
room.startLiveRecording(myRecordConfig, function(resp){
	if(resp.data.status.resultCode == 0) {
		// Recording initiated
	}
});

room.addEventListener("room-live-recording-on", function(event) {
     // Live recording is on
});

room.addEventListener("room-live-recording-failed", function(event) {
     // Failed to live record
});

Error Codes / Exceptions

CodeDescription
7000Generic Server Error
7011Start Live Recording timeout, Internal Server Error
7012Live Recording Request is in Process
7013Start Live Recording Request timeout, Internal Server Error
7014Recording will be made available post-session with a delay
7015Live Recording can’t be started now, please try after 2 minutes
7016Start Recording Input Parameters missing, Internal Server Error
7017Start Live Recording Input Parameters missing, Internal Server Error
7018Can’t start Live Recording, Internal Server Error
7019Live Recording already running
7020Start Streaming Failed, Internal Server Error
7201Only moderator can start Live Recording
7202Invalid URL format
7203Room is disconnecting, cannot start live recording
7204Live Recording error
7205Can’t start Live Recording, Fall-back tried but legacy recording already started

Stop Live Recording

MethodEnxRoom.stopLiveRecording(config, callback) – To stop live recording

Parameters:

  • config – Optional. You may pass Recording configuration data as it was passed with startLiveRecording() method.
  • callback – To receive the status response

Event Notifications:

  • room-live-recording-off – Notification to all users when Live Recording stops

Response Body:

{
	data = {
		status: {
                        resultCode: 0,
                        success: true,
                        error: { errorCode: 0, errorDesc: '' }
		},                                         
                stoppedBy = "7f0f2b04-1ad4-4231-8fdc-9f9e014053b4",
	},
        type = "room-live-recording-off";
}
var myRecordConfig={};  
 
room.stopLiveRecording(myRecordConfig, function(resp){
	if(resp.data.status.resultCode == 0) {
		// Stop live recording 
	}
});

room.addEventListener("room-live-recording-off", function(event) {
     // Live recording stopped
});

Error Codes / Exceptions

CodeDescription
7000Generic Server Error
7031Stop Live Recording timeout, Internal Server Error
7032Stop Live Recording timeout, Internal Server Error
7033Stop Live Recording timeout, Internal Server Error
7034Used internally
7035Failed to stop fall-back legacy recording
7036Only moderator can stop Live Recording
7037Room is disconnecting, Live Recording will be stopped

Error Codes

Call State Change Event

Code Description
7000Generic Server Error
7021Streaming/Recording Not requested, Invalid State
7022Start Streaming Failed, Internal Server Error
7023Call State Changed, could not find RTMP URL
7024Start Live Recording Failed, Internal Server Error
7025Call State Changed, could not get recording_name or recording_path
7026Call State Changed, got state as disconnected
7027Call State Changed, wrong state in request
7028Call State Changed, could not find allocated broker
7029Call State Changed Input Parameter confNum missing

Start Streaming

CodeDescription
7000Generic Server Error
7001Start Streaming timeout, Internal Server Error
7002Start Streaming Request is in process
7003Start streaming Request timeout, Internal Server Error
7004Streaming Can’t be started now, Please try after 2 minutes
7005Start Streaming Input Parameters missing, Internal Server Error
7006Start Streaming Input Parameters missing, please provide rtmpUrl and url
7007Start Streaming Input Parameters missing, Internal Server Error
7008Only moderator can start streaming
7009Invalid or undefined streaming configuration
7101rtmpUrl should not exceed more than 3 values
7102Invalid rtmp or url format
7103Room is disconnecting, cannot start streaming

Stop Streaming

ErrorDescription
7000Generic Server Error
7041Stop Streaming timeout, Internal Server Error
7042Stop Streaming Failed, Internal Server Error
7043Stop Streaming Failed, Internal Server Error
7044Only the moderator can stop streaming
7045Room is disconnecting, streaming will be stopped

Generic Error

ErrorDescription
7000Stop Streaming/Recording service Timeout
7000Stop Streaming/Live Recording service Failed, Internal Server Error
7000Invalid input stop Streaming/Recording service Failed, Internal Server Error

Move File CallBack

ErrorDescription
7000Generic Server Error
7051Recording File Movement failed
7052Recording File Movement failed

Live Recording Waiting Queue

ErrorDescription
7039Live recording request was in waiting, successfully removed the request from waiting
7046Streaming request was in waiting, successfully removed the request from waiting
7080Live recording/streaming request in waiting queue failed to start
7081Live recording/streaming request in waiting queue failed to start
7104 Streaming request is in waiting, will be started soon
7105 Last streaming request is in waiting
7207Live Recording request is in waiting, will be started soon
7208Last live Recording request is in waiting

Other Error Codes

ErrorDescription
7061Internal Server Error Live Recording cannot be started, please try again
7071Only moderator can change live recording params
7072Only moderator can change streaming params
7073User didn’t provided supported layout, Error in changing liveRecording
7074Live Recording/streaming not running cannot change params
7075User didn’t provided layout, Error in changing liveRecording
7076Recording file movement in process, cannot move log files now
7077Log File Movement failed
7078Room is disconnecting, cannot change streaming params
7079Room is disconnecting, cannot change live recording params