1 Access Process
ZEGO Cloud Recording supports RESTful API, no need to integrate SDK, you can easily start cloud recording directly through http network request.
2 Open Cloud Recording Service
Before you activate the cloud recording service, please make sure that you have completed the following preparations:
- Have an application that has been connected to the ZEGO real-time audio and video SDK.
- Open third-party cloud storage services, currently supporting Amazon S3, Alibaba Cloud OSS, Tencent Cloud COS, Qiniu Cloud Kodo, Alibaba Cloud Vod (supporting MP4, FLV formats).
After completing the above preparations, please contact ZEGO technical support to activate the cloud recording service.
3 Realize Cloud Recording
The following is a timing diagram of APIs that need to be called to implement cloud recording:
3.1 Get AccessToken
Before starting to record, you need to call the access_token method to obtain authentication credentials. In the following requests, you need to fill in the access_token field.
3.2 Start Recording
Call the start method and set the room number to enter the room for recording. If the request is successful, the corresponding recording task_id will be returned. This id is the unique identifier of the entire recording cycle and will be used as the request parameter for calling subsequent methods.
3.3 Query the Recording Status
During recording, you can call the query method multiple times to query the recording status, and you can get the recording status and file upload address in the returned response.
3.4 Update Mixed Flow Layout
3.5 Update Whiteboard
3.6 Stop Recording
Call the stop method to stop recording.
4 Manage Recording Files
4.1 Upload Recording Files
After the recording task is stopped, the recording files will be uploaded to the pre-designated third-party cloud storage. Call the query method, and you can check the upload progress in time through the returned parameters.
- file_url: Returns the upload address of the recording files.
- status: Returns the upload status of the recording files.
- video_id: Vod returns the video_id of the recording files.
After uploading the recording files, the cloud recording will call back and notify the callback address specified when the service is activated.
4.2 Manage Recording File Names
The recording file name contains information such as streamID and start recording time stamp. For details, please refer to the output_file_rule parameter of the start method.
- 1 1 Access Process
- 2 2 Open Cloud Recording Service
- 3 3 Realize Cloud Recording
- 3.1 3.1 Get AccessToken
- 3.2 3.2 Start Recording
- 3.3 3.3 Query the Recording Status
- 3.4 3.4 Update Mixed Flow Layout
- 3.5 3.5 Update Whiteboard
- 3.6 3.6 Stop Recording
- 4 4 Manage Recording Files
- 4.1 4.1 Upload Recording Files
- 4.2 4.2 Manage Recording File Names