Similar to thumbnail capture, but using the thumbnailset output allows multiple thumbnail images at distinct times to be captures in a single request.
<?xml version="1.0"?>
<query>
<userid>[UserID]</userid> {/* required */}
<userkey>[UserKey]</userkey> {/* required */}
<action>[Action]</action> {/* required */}
<source>[SourceFile]</source> {/* required */}
<format>
<output>thumbnailset</output>
<thumbnail>
<time>[Time]</time>
<width>[Width]</width>
<height>[Height]</height>
<quality>[Quality]</quality>
<file_extension>jpg</file_extension>
<keep_aspect_ratio>[yes|no]</keep_aspect_ratio>
<scale_mode>[pad|stretch|fit|cover|center]</scale_mode>
<allow_upscale>[yes|no]</allow_upscale>
<size_divisible_by>[N]</size_divisible_by>
<destination>[DestinationURL]</destination>
</thumbnail>
{/* Multiple thumbnails may be included */}
<thumbnail>
{/* thumbnail params */}
</thumbnail>
{/* Format params */}
</format>
</query>{
"query": {
"userid": "[UserID]", // required
"userkey": "[UserKey]", // required
"action": "[Action]", // required
"source": "[SourceFile]", // required
"format": {
"output": "thumbnailset", // required
"thumbnail": [
{
"time": "[Time]",
"width": "[Width]",
"height": "[Height]",
"quality": "[Quality]",
"file_extension": "jpg",
"keep_aspect_ratio": "[yes|no]",
"scale_mode": "[pad|stretch|fit|cover|center]",
"allow_upscale": "[yes|no]",
"size_divisible_by": "[N]",
"destination": "[DestinationURL]"
},
{
// thumbnail params
}
// Multiple thumbnails params may be included
]
// Format params
}
}
}| Parameter | Description | Allowed Values | Default Value |
|---|---|---|---|
| time | Specify the timestamp in seconds, percentage, or interval to capture thumbnails. | hh:mm:ss.ms – once created thumbnail from given timestamp. Example: <time>00:01:43.10</time>N% – Positive percentage number from 1 to 100%. Will generate thumbnail on N% of video duration. Example: <time>4%</time>N – Positive number greater than 0.01. Will generate thumbnail on N second. Example: <time>5.01</time>N! – Positive integer number greater or equals to 1. Will generate thumbnail on every N second. Example: <time>5!</time> | 5 |
| width | Specify the thumbnail width in pixels. | Positive integer | none |
| height | Specify the thumbnail height in pixels. | Positive integer | none |
| quality | Image Quality | Positive integer between 1 and 100 | 83 |
| file_extension | File Extension | jpg | none |
| keep_aspect_ratio | Keep image aspect ratio | yes, no | no |
| scale_mode | Specifies how the picture fits into width and height. pad – keep the aspect ratio and pad the picture, same as keep_aspect_ratio=yes. stretch – scale the picture to width and height, same as keep_aspect_ratio=no. fit – keep the aspect ratio without padding: the image fits within width and height, e.g. a square video in 210x158 gives 158x158. cover – keep the aspect ratio and fill width and height, the overflow is cropped evenly from both sides. center – no scaling: the picture is centered, cropped or padded to width and height. | pad, stretch, fit, cover, center | pad when keep_aspect_ratio=yes, stretch when keep_aspect_ratio=no |
| allow_upscale | When no, the picture is never scaled up: a source smaller than the size keeps its size with fit and cover or is padded to the size without scaling with pad. Can't be used with stretch. | yes, no | yes |
| size_divisible_by | Width and height calculated by fit or from width or height only are rounded to the nearest multiple of this value, never above the size. | Even integer from 2 to 64 | 2 |
| destination | Thumbnail destination | Valid URL | none |