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:
- Individual Participants Stream Recordings: Each users stream gets recorded individually and are made available for download. These files are in .MKV format.
- 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 Video API to get Files
Using Video 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
The Portal 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. The Portal supports delivery to the following location:
- FTP / SFTP to your Server
- SCP to your Server
- Amazon S3
- Azure Blob Storage
- Google Drive
Once configured, the Portal 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, The Portal notifies you through a Webhook Notification to help you automate workflow.
Get notified through Webhook
The Portal 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, the Portal 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" } }
- Know more about Room Creation Payload using our Video API.
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
Method: EnxRoom.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. 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.
- urlDetails – Its a JSON Object to define Custom View and its options.
callback
– The Callback method
Event Notifications:
– 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.room-live-recording-on
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.room-live-recording-updated
– Intermediate Notification to the moderator who tried to start Live Recording with start-process updates
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
Code | Description |
---|---|
7000 | Generic Server Error |
7011 | Start Live Recording timeout, Internal Server Error |
7012 | Live Recording Request is in Process |
7013 | Start Live Recording Request timeout, Internal Server Error |
7014 | Recording will be made available post-session with a delay |
7015 | Live Recording can’t be started now, please try after 2 minutes |
7016 | Start Recording Input Parameters missing, Internal Server Error |
7017 | Start Live Recording Input Parameters missing, Internal Server Error |
7018 | Can’t start Live Recording, Internal Server Error |
7019 | Live Recording already running |
7020 | Start Streaming Failed, Internal Server Error |
7201 | Only moderator can start Live Recording |
7202 | Invalid URL format |
7203 | Room is disconnecting, cannot start live recording |
7204 | Live Recording error |
7205 | Can’t start Live Recording, Fall-back tried but legacy recording already started |
Stop Live Recording
Method: EnxRoom.stopLiveRecording(config, callback)
– To stop live recording
Parameters:
config
– Optional. You may pass Recording configuration data as it was passed withstartLiveRecording()
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
Code | Description |
---|---|
7000 | Generic Server Error |
7031 | Stop Live Recording timeout, Internal Server Error |
7032 | Stop Live Recording timeout, Internal Server Error |
7033 | Stop Live Recording timeout, Internal Server Error |
7034 | Used internally |
7035 | Failed to stop fall-back legacy recording |
7036 | Only moderator can stop Live Recording |
7037 | Room is disconnecting, Live Recording will be stopped |
Error Codes
Call State Change Event
Code | Description |
---|---|
7000 | Generic Server Error |
7021 | Streaming/Recording Not requested, Invalid State |
7022 | Start Streaming Failed, Internal Server Error |
7023 | Call State Changed, could not find RTMP URL |
7024 | Start Live Recording Failed, Internal Server Error |
7025 | Call State Changed, could not get recording_name or recording_path |
7026 | Call State Changed, got state as disconnected |
7027 | Call State Changed, wrong state in request |
7028 | Call State Changed, could not find allocated broker |
7029 | Call State Changed Input Parameter confNum missing |
Start Streaming
Code | Description |
---|---|
7000 | Generic Server Error |
7001 | Start Streaming timeout, Internal Server Error |
7002 | Start Streaming Request is in process |
7003 | Start streaming Request timeout, Internal Server Error |
7004 | Streaming Can’t be started now, Please try after 2 minutes |
7005 | Start Streaming Input Parameters missing, Internal Server Error |
7006 | Start Streaming Input Parameters missing, please provide rtmpUrl and url |
7007 | Start Streaming Input Parameters missing, Internal Server Error |
7008 | Only moderator can start streaming |
7009 | Invalid or undefined streaming configuration |
7101 | rtmpUrl should not exceed more than 3 values |
7102 | Invalid rtmp or url format |
7103 | Room is disconnecting, cannot start streaming |
Stop Streaming
Error | Description |
---|---|
7000 | Generic Server Error |
7041 | Stop Streaming timeout, Internal Server Error |
7042 | Stop Streaming Failed, Internal Server Error |
7043 | Stop Streaming Failed, Internal Server Error |
7044 | Only the moderator can stop streaming |
7045 | Room is disconnecting, streaming will be stopped |
Generic Error
Error | Description |
---|---|
7000 | Stop Streaming/Recording service Timeout |
7000 | Stop Streaming/Live Recording service Failed, Internal Server Error |
7000 | Invalid input stop Streaming/Recording service Failed, Internal Server Error |
Move File CallBack
Error | Description |
---|---|
7000 | Generic Server Error |
7051 | Recording File Movement failed |
7052 | Recording File Movement failed |
Live Recording Waiting Queue
Error | Description |
---|---|
7039 | Live recording request was in waiting, successfully removed the request from waiting |
7046 | Streaming request was in waiting, successfully removed the request from waiting |
7080 | Live recording/streaming request in waiting queue failed to start |
7081 | Live 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 |
7207 | Live Recording request is in waiting, will be started soon |
7208 | Last live Recording request is in waiting |
Other Error Codes
Error | Description |
---|---|
7061 | Internal Server Error Live Recording cannot be started, please try again |
7071 | Only moderator can change live recording params |
7072 | Only moderator can change streaming params |
7073 | User didn’t provided supported layout, Error in changing liveRecording |
7074 | Live Recording/streaming not running cannot change params |
7075 | User didn’t provided layout, Error in changing liveRecording |
7076 | Recording file movement in process, cannot move log files now |
7077 | Log File Movement failed |
7078 | Room is disconnecting, cannot change streaming params |
7079 | Room is disconnecting, cannot change live recording params |