Single Stream Transcoding Started Callback
Description
When developers need to understand the single stream transcoding tasks of the current App, they can refer to Callback Configuration Description to configure related callback interfaces. After successfully initiating a Start Single Stream Transcoding request, they can view the result of the transcoding task through this callback.
Callback instructions
- Request method: POST.
The callback data format is JSON. You need to perform UrlDecode decoding on it.
- Request URL: Please contact ZEGOCLOUD Technical Support to configure the callback URL.
- Transfer protocol: HTTPS/HTTP. HTTPS is recommended.
Callback parameters
| Common parameters | Type | Description |
|---|---|---|
| Event | String | Callback event. This callback returns transcode_start. |
| Appid | String | Unique identifier of the App. |
| Timestamp | String | Server current time, Unix timestamp. |
| Nonce | String | Random number. |
| Signature | String | Verification string. For details, see Verification instructions. |
| Business parameters | Type | Description |
|---|---|---|
| TaskId | String | Unique identifier ID of the single stream transcoding task. |
| UserId | String | User ID of the user who initiated the start single stream transcoding task, customized by the developer. |
| Sequence | Int | Sequence number of initiating the transcoding task. |
| Status | String | Status of the transcoding task. The return values are:
|
| Details | Object | Detailed information of the transcoding task. |
| └ Input | Object | Input stream information of the transcoding task. For details, see Input. |
| └ Outputs | Array of Object | Output stream information of the transcoding task. For details, see Outputs. |
Input
| Common parameters | Type | Description |
|---|---|---|
| StreamId | String | Transcoding input stream ID. |
| StreamUrl | String | Transcoding input stream URL. |
Outputs
| Common parameters | Type | Description |
|---|---|---|
| StreamId | String | Transcoding output stream ID. |
| StreamUrl | String | Transcoding output stream URL. |
| VideoEncId | Int | Video encoding format of the transcoding output stream. |
| VideoBitrate | Int | Bitrate of the transcoding output stream. |
| ShortEdgeAdaption | Int | Whether the resolution of the transcoding output stream is set to adaptive portrait/landscape according to the short edge. |
| Fps | Int | Frame rate of the transcoding output stream. |
| Width | Int | Resolution (width) of the transcoding output stream. |
| Height | Int | Resolution (height) of the transcoding output stream. |
| GOP | Int | Keyframe interval of the transcoding output stream. |
Data example
{
"Event": "transcode_start",
"Appid": "111111",
"Timestamp": "timestamp",
"Nonce": "nonce",
"Signature": "signature",
"TaskId": "2222",
"UserId": "2222",
"Sequence": 0,
"Status": "TranscodeStarted",
"Details": {
"Input": {
"StreamId": "2222"
},
"Outputs": [
{
"StreamId": "2222",
"VideoEncId": 0,
"Fps": 0,
"ShortEdgeAdaption": 0,
"Width": 1280,
"Height": 720,
"VideoBitrate": 0,
"GOP": 2
}
]
}
}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.
