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

On-Demand Screenshot Callback


Description

After developers complete media file transcoding through the Start On-Demand Screenshot interface, they can query screenshot information 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 snapshot - Screenshot completed.
appidStringUnique identifier of the App.
timestampStringServer current time, Unix timestamp.
nonceStringRandom number.
signatureStringVerification string. For details, see Verification instructions.
Business parametersTypeDescription
task_idStringScreenshot task ID, consistent with the task_id in the response result of Start On-Demand Screenshot.
vendorStringCDN vendor:
  • tencent: Tencent Cloud.
  • hw: Huawei Cloud.
field_idStringSource media file ID.
This field is only available when the CDN vendor is Tencent Cloud.
snapshot_pic_listArray SnapshotPicObjectJSON array format string of on-demand screenshot information list.
└ urlstringOn-demand screenshot URL
└ offsetfloatTime offset in the video file corresponding to this screenshot, i.e., the screenshot at how many milliseconds, unit: milliseconds.
This field is only available when the CDN vendor is Tencent Cloud and under the condition of time-point screenshots.

Data example

{
        "appid": "12345",
        "event": "snapshot",
        "timestamp": "148150008",
        "nonce": "158243",
        "signature": "signature"
        "task_id": "1253642700910365374",
        "field_id": "abcwurywbhsfwi",
        "vendor": "tencent",
        "snapshot_pic_list": "[{\"url\":\"http://abc.com/1.jpg\",\"offset\":0},{\"url\":\"http://abc.com/1.jpg\",\"offset\":0}]",
}

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

On-Demand Transcoding Completed Callback

Next

Audio Stream Moderation Callback

On this page

Back to top