GenerateSnapshot
) is used to get a screenshot of a media file at some time point. All output screenshots are in JPEG format.POST /snapshot HTTP/1.1Host: <BucketName-APPID>.ci.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>Content-Length: <length>Content-type: application/xml<body>
<Request><Input><Object></Object></Input><Time></Time><Width></Width><Height></Height><Mode></Mode><Rotate></Rotate><Format></Format><Output><Region></Region><Bucket></Bucket><Object></Object></Output></Request>
Node Name (Keyword) | Parent Node | Description | Type | Required |
Request | None | Generate Snapshot request container | Container | Yes |
Request
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
Input | Request | Media file location information. | Container | Yes |
Time | Request | Screenshot time point in seconds. | Float | Yes |
Output | Request | Screenshot storage location information. | Container | Yes |
Width | Request | Screenshot width. Default value: 0. | Int | No |
Height | Request | Screenshot height. Default value: 0. If Width and Height are both 0 , the width and height of the video are used. If one of them is 0 , the other value is used to automatically adapt to the aspect ratio of the video. | Int | No |
Format | Request | Screenshot format. Valid values: jpg, png. Default value: jpg. | String | No |
Mode | Request | Frame capturing method: keyframe: Capture the last keyframe before the specified time point. exactframe: Capture the frame at a specified time point. Default value: exactframe | String | No |
Rotate | Request | Image rotation method: auto: Rotate automatically according to the video rotation information. off: Do not rotate. Default value: auto | String | No |
Input
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
Object | Request.Input | Filename | String | Yes |
Output
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
Region | Request.Output | Bucket region | String | Yes |
Bucket | Request.Output | File bucket | String | Yes |
Object | Request.Output | Filename | String | Yes |
<Response><Output><Region></Region><Bucket></Bucket><Object></Object></Output></Response>
Node Name (Keyword) | Parent Node | Description | Type |
Response | None | Response container | Container |
Response
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type |
Output | Request | Screenshot storage location information | Container |
Output
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type |
Region | Response.Output | Bucket region | String |
Bucket | Response.Output | File bucket | String |
Object | Response.Output | Filename | String |
POST /snapshot HTTP/1.1Host: examplebucket-1250000000.ci.ap-beijing.myqcloud.comDate: Fri, 10 Mar 2016 09:45:46 GMTAuthorization: q-sign-algorithm=sha1&q-ak=AKIDWtTCBYjM5OwLB9CAwA1Qb2ThTSUj****&q-sign-time=1484213027;32557109027&q-key-time=1484213027;32557109027&q-header-list=host&q-url-param-list=acl&q-signature=dcc1eb2022b79cb2a780bf062d3a40e120b4****Content-Length: 552Content-Type: application/xml<Request><Input><Object>video-for-test.mp4</Object></Input><Time>10</Time><Output><Region>ap-beijing</Region><Bucket>ci-output-1250000000</Bucket><Object>snapshot/video-for-test-snapshot.jpg</Object></Output></Request>
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 266Connection: keep-aliveDate: Fri, 10 Mar 2016 09:45:46 GMTServer: tencent-cix-ci-request-id: NTg3NzRiMjVfYmRjMzVfMTViMl82ZGZm****<Response><Output><Region>ap-beijing</Region><Bucket>ci-output-1250000000</Bucket><Object>snapshot/video-for-test-snapshot.jpg</Object></Output></Response>
Was this page helpful?