logo
Voice Call
Server API
Stream Mixing and Transcoding APIs
On this page

StartCDNRecord

GET

https://rtc-api.zego.im/

CDN can be configured to record all live streams, if you need to select and record a specific live stream, you can call this interface to implement it. For related callbacks, please refer to Recording File Generation Callback.

When using the CDN service provided by Tencent Cloud, the following recording parameters need to be clarified:

  • Recording file format: Supports M3U8, FLV, MP4, AAC (audio only) and MP3 (audio only).
  • Recording interval: Duration of the recording file, in seconds (s), the value range is 300 s ~ 7200 s, the default value is 7200 s. This parameter is invalid for M3U8 recording file format. If you want the duration of the recording file to exceed 7200 s (2 hours), you need to use the recording file merging interface to merge multiple recording files.
  • Storage duration: Clarify the retention period of the recording file.
Warning

Before using this interface, you need to clarify the recording parameters, then synchronize the recording parameters to ZEGOCLOUD Technical Support for configuration, or go to ZEGOCLOUD Console for self-service configuration, for details, please refer to Console - Service Configuration - CDN.

Call frequency limit
All rooms under the same AppID are limited to 20 times/second

Request

Query Parameters

    Action stringrequired

    Possible values: [StartCDNRecord]

    Interface prototype parameters

    https://rtc-api.zego.im?Action=StartCDNRecord

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.

    Timestamp int64required

    💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.

    Signature stringrequired

    💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    StreamId string[]required

    Possible values: >= 1

    [object Object]

    Vendor stringrequired

    Possible values: [Tencent, Ws, Huawei]

    CDN vendor name。

    Tencent:Tencent Cloud。 Ws:Wangsu。 Huawei:Huawei Cloud。
    EndTime string

    Recording task end time, Unix timestamp. The set time must be greater than the current time, and cannot exceed 24 hours from the current time.

    This parameter only takes effect when Vendor is "Tencent".

Responses

Success
Schema
    Code number

    The following only lists the return codes related to interface business logic. For complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionHandling Suggestion
    0Request successful.-
    2Input parameter error.-
    3Related permissions not activated.Please contact ZEGOCLOUD Technical Support.
    4CDN type mismatch.Please check the parameters.
    5Configuration error.Please contact ZEGOCLOUD Technical Support.
    6Request too frequent.Please try again later.
    7Authentication failed.Please check if the authentication parameters are correct.
    1000Request failed.Please contact ZEGOCLOUD Technical Support.
    Message string

    Operation result description。

    RequestId string

    Request ID

    Data object
    Response data。
    Tencent object[]
    Tencent Cloud return content (returned when Vendor is Tencent)。
  • Array[
  • StreamName string

    Stream name

    TaskId string

    Task ID

    RequestId string

    Unique request ID

    Code string

    Error code of the current stream

    Message string

    Current stream error message。

  • ]
  • Ws object
    Wangsu return content (returned when Vendor is Ws)。
    msg object

    Operation result prompt message。

    http_code int32

    Business operation status。

    trace_id string

    Serial number。

    call_time string

    Request initiation time。

    list object[]
  • Array[
  • task string

    Format of the recording file。

    id string

    Stream name

    http_code int32

    The operation status of this task

    msg string

    The operation result prompt message of this task。

    persistentId string

    The file identifier of this task。

  • ]
  • Huawei object[]
    Huawei Cloud return content (returned when Vendor is Huawei)。
  • Array[
  • StreamName string

    Stream name

    RequestId string

    Unique request ID

    Code int32

    Error code of the current stream recording

    Message string

    Current stream recording error message。

  • ]

Previous

DescribeRTCStreamState

Next

StopCDNRecord

On this page

Back to top