Conference Call Recording
Unlike regular broadcast streams, conference calls have multiple participants, each with a unique streamId. Therefore, the regular recording mechanism cannot be used in conference calls. Instead of recording each participant's stream individually, we need a solution to merge all the streams and record the entire room.
- In this document, we will learn how to easily record Ant Media Server conference calls using the sample page multitrack-play.html and the Media Push plugin.
Media Push Plugin
The Media Push plugin is an open-source plugin that is built on top of Ant Media Server that can load any web URL and stream it in real-time.
- Media Push opens up a Headless chrome on the server side. A user can send a REST request with the URL of the page that is desired to be recorded. When the request is received on the server side, a new Chrome tab is opened with the URL. As soon as the page gets loaded, the screen is recorded using Media Stream APIs and re-streamed back to Ant Media Server.
Installing Media Push Plugin
-
Connect your Ant Media Server instance via terminal.
-
Download the installation script:
wget -O install_media-push-plugin.sh https://raw.githubusercontent.com/ant-media/Plugins/master/MediaPushPlugin/src/main/script/install_media-push-plugin.sh && chmod 755 install_media-push-plugin.sh
-
Run the installation script:
sudo ./install_media-push-plugin.sh
-
Restart the service:
sudo service antmedia restart
Recording the Conference Call
Recording the conference call is essentially a four-step process:
- Joining the conference room.
- Merging all the participants in the conference room with multitrack-play.html or merge_streams.html.
- Capturing the merged streams with the Media push plugin & sending it back to the Ant Media Server.
- Recording the merged room stream.
Now, let's discuss all these steps individually and see how they are done.
Joining a Conference Room
There are various ways to join a conference call from different devices and platforms, such as the Web i.e., from the sample conference page conference.html or using the mobile SDKs like Android or iOS, etc.
-
Let's join the conference room with
roomid' as
room1, also known as the
maintrack`. -
All participant's streamIds (subtracks) can be seen on the web panel along with the room.
Merging the Conference Streams
The multitrack-play.html sample page, merges all the participants of the conference room dynamically & the same can be accessed at:
https://Server-URL:5443/live/multitrack-play.html?id=roomid
Here:
Server-URL
is your Ant Media Server URL/Domain.live
is the application name.roomid
is the room name or maintrack. In this example, we have used room1
You do not need to explicitly open this sample page in the browser to merge the participant's streams; it will continue running in the background to merge the streams dynamically.
Initializing the Media Push Plugin
The Media Push plugin can be called with a REST API to capture the sample page multitrack-play.html
& stream it back to the Ant Media Server.
curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "http://localhost:5080/live/rest/v1/media-push/start" -d '{"url": "http://localhost:5080/live/multitrack-play.html?id=room1", "width": 1280, "height": 720}'
-
In the above example, the Media Push Plugin captures the sample page & streams it back to the Ant Media Server.
-
The merged stream will have all the participant's streams of the room & it is updated dynamically.
Recording the Merged Stream
Now that we have the merged stream, we can make the API call to start recording the stream with MP4.
curl -X PUT -H "Content-Type: application/json" "https://localhost:5080/live/rest/v2/broadcasts/JQzivjSFdVTJ1738919890828/recording/true"
Alternatively, the recording can also be started from the web panel.
-
In addition to MP4, the stream can also be recorded with HLS.
-
To stop the MP4 recording, again you can make the REST call.
curl -X PUT -H "Content-Type: application/json" "https://localhost:5080/live/rest/v2/broadcasts/JQzivjSFdVTJ1738919890828/recording/false"
-
To record the broadcast in addition to streaming, you can include the recordType option in your REST API call. This option specifies the format in which the broadcast should be recorded. Here's how you can modify the previous start broadcast command to include recording:
curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "${ANT_MEDIA_SERVER_BASE_URL}/${APP_NAME}/rest/v1/media-push/start" -d '{"url": "'"${URL_TO_RECORD}"'", "width": 1280, "height": 720, "recordType":"mp4"}'
-
This command will initiate the broadcast of the specified URL and simultaneously record it in MP4 format. Ensure to replace
${URL_TO_RECORD}
with the actual URL you want to broadcast and record. In this case, the sample page URL merges the conference room streams.
Stop the Media Push Plugin broadcast
Once the conference ends, to stop the media push created broadcast on the Ant Media Server, you can call the REST method as outlined below.
curl -i -X POST -H "Accept: Application/json" -H "Content-Type: application/json" "http://localhost:5080/live/rest/v1/media-push/stop/JQzivjSFdVTJ1738919890828"
- Make sure the streamId matches the one you obtained when initiating the broadcast.
- To learn more about the Media Push Plugin usage, check How to Use
Recording Conference calls on Circle
With the Circle conference call application, the recording feature is seamlessly integrated.
-
If the Media Push plugin is installed on the server, the
Start Recording
button appears under More Options when you click the gear icon after joining the conference call. -
Clicking on the start recording will start to record the composite room stream with the Media Push plugin.
-
Similarly, you can stop the recording when done.
-
After the recording is stopped, the recorded file will be visible under the VoD section of the application.
This is how you can record the conference call on the Ant Media Server with the help of the Media Push Plugin.