All Products
Search
Document Center

SnapshotComplete

Last Updated: Sep 04, 2018

Event type

SnapshotComplete

Event description

A SnapshotComplete event is generated after a video screenshot is taken.

Notes:

  • The screenshot and transcoding tasks are processed in parallel. Therefore, you cannot prioritize the two operations.
  • If you do not set a cover (CoverUrl), the first screenshot is used as the cover by default.
  • You can also call the Get video information operation to obtain the cover and screenshot URLs.
  • If URL authentication has been enabled, you must generate an authentication key (auth_key) to access the image URL. Otherwise, an HTTP 403 error is returned.

Event content

Name Type Required Description
EventTime String Yes The time when the event occurs in UTC-8. Format: yyyy-MM-ddTHH:mm:ssZ.
EventType String Yes The type of the video. The value is SnapshotComplete.
VideoId String Yes The ID of the video.
Status String Yes The status of the video screenshot task. A value of success indicates that the screenshot task is successful. A value of fail indicates that the screenshot task has failed. When the screenshot task is successful, the system returns the screenshot information fields. Otherwise, the system returns a error.
JobId String Yes The ID of the screenshot task.
ErrorCode String No The error code returned when the video screenshot task fails.
ErrorMessage String No The error message returned when the video screenshot task fails.
SubType String No The type of the screenshot task. The value is SpecifiedTime. This field is included only if you have specified the time to take a screenshot.
SnapshotCount Integer No The number of normal screenshots. This field is not included if sprites are captured but no thumbnail is retained.
SnapshotRegular String No The rule for generating normal screenshot URLs. This field is not included if sprites are captured but no thumbnail is retained.
SpriteSnapshotCount Integer No The number of sprites. This field is included when sprites are captured.
SpriteSnapshotRegular String No The rule for generating sprite URLs. This field is included when sprites are captured.
CoverUrl String No The URL of the cover image. If no cover is set, the first screenshot is used as the cover.
Snapshots String[] No A list of screenshot URLs. This field is not included if you have specified the time to take a screenshot.

Callback example

The following example shows the body of an HTTP POST request for HTTP callbacks.

  1. {
  2. "EventTime": "2017-03-20T07:49:17Z",
  3. "EventType": "SnapshotComplete",
  4. "VideoId": "43q9fjasjdflask",
  5. "Status": "success",
  6. "SnapshotCount": 95,
  7. "SubType": "SpecifiedTime",
  8. "VideoId": "93ab850b4f6f44eab54b6e91d24d81d4",
  9. "SpriteSnapshotCount": 10,
  10. "CoverUrl": "https://image.example.com/coversample.jpg",
  11. "SnapshotRegular": "http://image.example/snapshot/sample{SnapshotCount}.jpg",
  12. "SpriteSnapshotRegular": "http://image.example/snapshot/sample{SpriteSnapshotCount}.jpg",
  13. "Snapshots":[
  14. "http://image.example.com/snapshot/sample000001.jpg",
  15. "http://image.example.com/snapshot/sample00002.jpg",
  16. ...
  17. ]
  18. }