Server APIs v2
  • Server APIs overview
  • Accessing Server APIs
  • Room signaling
  • Stream mixing
  • Streaming moderation
  • Streaming control
  • Cloud recording
  • Server callbacks
  • Return codes
  • API testing

Merge recorded files on CDN

Last updated:2022-03-22 13:07

1 Description

Merges multiple recorded files into one. Currently, only mp3, mp4 and m3u8 files are supported.

To use the CDN recording service, you will need to contact ZEGO Technical Support to enable it first. For pricing details, you can check with our sales. When the media file is merged, it will be notified through the Callback on recorded files merged.

2 Request method and endpoint

  • Request method: GET
  • Request endpoint: https://rtc-api.zego.im/?Action=MergeMedia
  • Transmission protocol: HTTPS
  • Rate limit: 20 requests/second

3 Request parameters

Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Server APIs public request parameters.

Parameter Type Required Description
Vendor
String
Yes
The CDN provider.
  • Tencent: Tencent Cloud
Format
String
No
Recording file format (for Tencent Cloud: mp3, mp4 and m3u8).
InputFileId[]
Array of String
Yes
File IDs of the files to be merged. The merging will be done in listing order.
Example: InputFileId[]=5285890813221514958&InputFileId[]=5285890813221513290
OutputFileName
String
Yes
The file name of the merged file, excluding the file format.

4 Request example

https://rtc-api.zego.im/?Action=MergeMedia
&Vendor=Tencent
&Format=mp3
&InputFile[]=5285890813221514958&InputFile[]=5285890813221513290
&OutputFile=dt6
&<Public Request Parameters>

5 Response parameters

Parameter Type Description
Code
Number
Return code.
Message
String
Description of the request execution result.
RequestId
String
Request ID.
Data
Object
Returned data.
└ Tencent
Object
Returned data from Tencent Cloud.
  └ TaskId
String
The task ID of the production media file, through which the merge task can be queried.
  └ RequestId
String
Unique request ID, returned on every request. When locating the problem, you need to provide the RequestId of the request.

6 Response example

{
    "Code":0,
    "Message":"success",
    "RequestId":"3574501647605445341",
    "Data":
      {
        "Tencent":
           {
             "TaskId":"1400341231-EditMedia-0d8b6f0a5c457f5722e6b27796ce1f2ctt0",
             "RequestId":"07f0bdbc-6a52-4ef9-ba7b-e96d6c81d6c3"
           }
      }
}

7 Return codes

Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.

Return code Description
41001 Failed to save live stream.
41002 Failed to save channel.
41003 Live stream does not exist.
41004 Stream no longer exists.
42001 Failed to forbid live stream.
42002 Failed to resume live stream.
42003 Batch disable live broadcast failed.
42004 Failed to resume live streaming in batches.
43001 Failed to create recording index file.