Create thumbnails from your source videos
When creating thumbnails there are two different approaches to set images based on whether you want a single thumbnail to be created at a specific point of the video (Single frame thumbnails) or thumbnails created at an interval of seconds (interval-based thumbnails). Here is a quick overview of how these different types of thumbnails are created through the API:
- Single frame thumbnails: Thumbnails created from a single frame defined in percentage of duration. Set outputto thumbnail and settimeto the percentage of video duration you want to pull the thumbnail from.
- Interval-based thumbnails: Thumbnails created by intervals defined in seconds. Set outputto thumbnail and setintervalto a value in seconds for the interval in which thumbnails should be created.
Single frame thumbnails
Creating a single frame thumbnail allows you to select specific parts of the video for images to be created. Single frame thumbnails are created using the following parameters.
The
Example: time = 0 (beginning of the video, at 0% of duration) time = 50 (middle of the video, at 50% of duration) time = 100 (end of the video, at 100% of duration)
The
If you set multiple
The
To create single frame thumbnails, create a format and set the output attribute to “thumbnail”. Enter the time, width, height, destination and user tag. Make sure to specify the full url in the destination.url field (ie: s3://s3.nyc3.qencode.com/bucket/thumb/50_320x240.png)
Example of Single frame thumbnail
{
"output": "thumbnail",
"time": "0.50",
"width": "320",
"height": "240",
"destination": {
"url":"s3://s3.nyc3.qencode.com/bucket/thumb/50_320x240.png",
"key":"your_access_key",
"secret":"your_secret_key",
"permissions": "public-read"
},
"user_tag": "50_320x240"
}
Interval-based thumbnails
Creating an interval-based thumbnail allows you to create images at many points of the video based on an interval of time that you define.
The
Example: interval = 20 (an image will be created every 20 seconds)
Just like with single frame thumbnails and videos, the
To create single frame thumbnails, create a format and set the output attribute to “thumbnails”. Enter the destination, time, width, and height. Make sure to specify the full path to where you want the images and .vtt file to be saved in the
Example of Interval-based thumbnail
{
"output" : "thumbnails",
"destination": {
"url":"s3://s3.nyc.qencode.com/bucket/thumb/",
"key":"your_access_key",
"secret":"your_secret_key",
"permissions": "public-read"
},
"interval": 30,
"width" : 320,
"height" : 240
}