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

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.
Note

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 parametersTypeDescription
EventStringCallback event. This callback returns transcode_start.
AppidStringUnique identifier of the App.
TimestampStringServer current time, Unix timestamp.
NonceStringRandom number.
SignatureStringVerification string. For details, see Verification instructions.
Business parametersTypeDescription
TaskIdStringUnique identifier ID of the single stream transcoding task.
UserIdStringUser ID of the user who initiated the start single stream transcoding task, customized by the developer.
SequenceIntSequence number of initiating the transcoding task.
StatusString

Status of the transcoding task. The return values are:

  • TranscodeStarted: The transcoding task has been started.
  • TranscodeUpdated: The transcoding task has been updated.
DetailsObjectDetailed information of the transcoding task.
└ InputObjectInput stream information of the transcoding task. For details, see Input.
└ OutputsArray of ObjectOutput stream information of the transcoding task. For details, see Outputs.

Input

Common parametersTypeDescription
StreamIdStringTranscoding input stream ID.
StreamUrlStringTranscoding input stream URL.

Outputs

Common parametersTypeDescription
StreamIdStringTranscoding output stream ID.
StreamUrlStringTranscoding output stream URL.
VideoEncIdIntVideo encoding format of the transcoding output stream.
VideoBitrateIntBitrate of the transcoding output stream.
ShortEdgeAdaptionIntWhether the resolution of the transcoding output stream is set to adaptive portrait/landscape according to the short edge.
FpsIntFrame rate of the transcoding output stream.
WidthIntResolution (width) of the transcoding output stream.
HeightIntResolution (height) of the transcoding output stream.
GOPIntKeyframe 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.

Previous

Stream Mixing Stopped Callback

Next

Single Stream Transcoding Stopped Callback

On this page

Back to top