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

Recording File Generated Callback


Description

When developers need to implement live replay functionality, after enabling background recording, when a stream is recorded on the CDN, the APP will make a POST request to the callback URL.

Callback instructions

  • Request method: POST.
Note

The callback data format is JSON. You need to perform UrlDecode decoding on it.

  • Request URL: Please configure the callback URL on the ZEGOCLOUD Console.
  • Transfer protocol: HTTPS/HTTP. HTTPS is recommended.

Callback parameters

ParameterTypeDescription
stream_aliasStringStream name, corresponds to the client's StreamID, not exceeding 255 bytes.
replay_urlStringReplay URL, not exceeding 1024 bytes.
begin_timeStringStart time, Unix timestamp.
end_timeStringEnd time, Unix timestamp.
timestampStringServer current time, Unix timestamp.
nonceStringRandom number.
signatureStringVerification string. For details, see Callback instructions - Verification instructions.
appidStringAppId.
eventStringCallback event. This callback returns record.
extra_paramsStringExtended field. Different CDN vendors have different extended fields. Please refer to the table below.

When using CDN services from different vendors, the extra_params parameter is as follows:

CDN vendorextra_params parameterTypeDescription
TencentTaskIdStringUnique identifier of the recording task.
FileIDStringUnique identifier of the recording file.
DurationFloatRecording duration.
WsPersistentIdStringUnique identifier of the recording.
DurationFloatRecording duration.
HuaweiDurationFloatDuration of the recording file, unit: seconds.
ObsObjectStringOBS storage path of the recording file.
FileSizeUInt32File size, unit: Byte.

Data example

{
    "stream_alias": "aaaa",
    "replay_url": "replay_url",
    "begin_time": "1481597358",
    "end_time": "1481597358",
    "timestamp": "1481597358",
    "nonce": "158273",
    "signature": "signature",
    "appid": "1",
    "event": "record",
    "extra_params": "extra_params"
}

Return response

Return HTTP status code 2XX (e.g., 200) indicates success, and other responses indicate failure.

Callback retry strategy

If the ZEGO server does not receive a response, or the received HTTP status code is not 2XX (e.g., 200), it will attempt to retry, up to 5 retries. The interval between each retry request and the previous request is 2s, 4s, 8s, 16s, and 32s respectively. If the 5th retry still fails, no more retries will be made, and the callback will be lost.

Previous

Single Stream Transcoding Stopped Callback

Next

Media File Merge Completed Callback

On this page

Back to top