Overview
The Thumbnail API (http://cdn.kaltura.com/p/{partner_id}/thumbnail/entry_id/{entry_id}) provides an easy interface to dynamically manipulate images or video snapshots to be used as thumbnails.
The result of the thumbnail API is:
- A re-sized / cropped version of the original thumbnail image.
- A specific frame from a video clip.
- An older version of the entry thumbnail.
- A various compression quality of the thumbnail image.
Using the thumbnail API
The parameters are passed in the following form
http://my.kalturaserver.com/p/{partner_id}/thumbnail/entry_id/{entry_id}/param1_name/param1_value/param2_name/param2_value...
- Replace {partner_id} with your partner id.
- Replace {entry_id} with if of desired entry thumbnail.
API Parameters
| Parameter name | Type | Mandatory | Description |
|---|---|---|---|
| entry_id | String | Yes | The entry ID |
| widget_id | String | No | The widget ID |
| version | integer | No | The thumbnail version |
| width | integer | No | Requested width in pixels |
| height | integer | No | Requested height in pixels |
| type | integer | No | Type of crop to be used – see remarks below |
| bgcolor | string | No | 6 hex digits web colorcode |
| crop_provider | string | No | Internal |
| quality | string | No | Jpeg quality for output (0-100). The default is 75 |
| src_x | integer | No | 1st part of a rectangle to take from original picture |
| src_y | integer | No | 2nd part of a rectangleto take from original picture |
| src_w | integer | No | 3rd part of a rectangleto take from original picture |
| src_h | integer | No | 4th part of a rectangleto take from original picture |
| vid_sec | integer | No | second to snap from video |
| vid_slice | integer | No | Number of slice out of number of slices |
| vid_slices | integer | No | Number of slices |
Parameters usage
- If both width and height were given a zero value the original image will be returned.
- If neither width nor height were specified, the resulting size will be 120x90 (default thumbnail size).
- If only width or height were specified, the given dimension combined with the type parameter will control the resulting size of the image.
- If vid_slices is provided without vid_slice the result will be a horizontal strip with the different slices.
- The 'type' parameter controls the resize/cropping options:
- resize according to the given dimensions while maintaining the original aspect ratio.
- place the image within the given dimensions and fill the remaining spaces using the given background color.
- crop according to the given dimensions while maintaining the original aspect ratio. The resulting image may be cover only part of the original image.
- crops the image so that only the upper part of the image remains.
Examples
- A thumbnail with the dimensions of 500X400 (with maintain aspect-ratio from original) and defined quality
http://cdn.kaltura.com/p/0/thumbnail/entry_id/3f37s020so/width/500/heigh... - Using vid_sec parameter
- The following will capture the 10 second frame as the thumbnail
http://cdn.kaltura.com/p/17411/sp/1741100/thumbnail/entry_id/xbyv2rf5q8/... - By changing the value of vid_sec we are able to capture the 60 second frame as my thumbnail
http://cdn.kaltura.com/p/17411/sp/1741100/thumbnail/entry_id/xbyv2rf5q8/...
- The following will capture the 10 second frame as the thumbnail
- Using src_x/y/w/h
- Original image: width=500, height=400, x=10
http://cdn.kaltura.com/p/17411/sp/1741100/thumbnail/entry_id/xbyv2rf5q8/... - Edited: crop a thumbnail of the following size width=100, height=100 starting at x=100, y=100
http://cdn.kaltura.com/p/17411/sp/1741100/thumbnail/entry_id/xbyv2rf5q8/...
- Original image: width=500, height=400, x=10



