Currently we offer a ruby SDK (which will work with or without rails) and a PHP SDK.
Ruby SDK |
PHP SDK
Name |
Description |
Values |
Required |
Default |
developer_mode |
If true request is free and resulting thumbnails are watermarked
| boolean | No | true |
token |
Your Api Key
| string | Yes | N/A |
source |
Your Video URL
| URL | Yes | N/A |
upload_url |
Where you wish the thumbnails to be uploaded
| URL | Yes | N/A |
number_of_thumbnails |
Number of thunbails required
| non-zero positive integer | No | 1 |
thumbnail_format |
Format of requested thumbnails
| jpg OR png | No | jpg |
width |
Desired thumbnail width
| non-zero positive integer | No | 120 |
height |
Desired thumbnail height
| non-zero positive integer | No | 90 |
thumbnail_styles |
Style of thumbnails to be created
| individual,gif,capsheet | No | individual |
scale_mode |
Select method to scale the thumbnails
| pad OR stretch OR crop | No | pad |
pad_color |
Background color for padded thumbnails
| Hex color value | No | 000000 |
upload_placeholders |
If placeholders should be uploaded
| boolean | No | true |
callback_url |
URL to be called on success/failure
| URL | No | N/A |
external_id |
If set, this will be sent with the callback.
| string | No | N/A |
Animated Gif |
gif_framerate |
Delay between frames of created GIF (in hundreths of seconds)
| non-zero positive integer | No | 30 |
Capsheet |
capsheet_columns |
Number of columns on capsheet
| non-zero positive integer | No | 3 |
capsheet_video_info |
Display video info on capsheet
| boolean | No | true |
capsheet_timestamp |
Display timestamp on capsheet thumbnails
| boolean | No | true |
Signature |
server_time |
Your server time as a Unix timestamp
| Timestamp | Yes | N/A |
hash |
Signed hash of your parameters
| String | Yes | N/A |
Required: No
Values: boolean
Default: N/A
developer_mode is a boolean flag that allows you to generate thumbnails without spending any credits. We recommend turning developer mode on when intergrating grabb.io with your site. Note: The thumbnails generated when in developer mode are given a grabb.io watermark.
Required: Yes
Values: string
Default: N/A
Your API key, you automatically receive one when you register and it can be found on the
My Account section of this website. This must be included with all API keys. You will receive an error if the token is missing or invalid.
Required: Yes
Values: URL
Default: N/A
The location of the video you wish the generate thumbnails for. Both HTTP and RTMP links are supported. If a live RTMP stream is provided then the first 60 seconds will be captured and used for the thumbnails. If the video is inaccessible then you will receive an error with the HTTP response code.
Required: Yes
Values: URL
Default: N/A
The destination for the thumbnails. FTP and S3 protocols are supported, you will receive an error in the account section if these are unreachable.
FTP
When using FTP, the format is:
ftp://USERNAME:PASSWORD@HOST
S3
WHen using S3, The format is:
s3://BUCKET_NAME Please make sure that the bucket you wish to write to has write access for the user
[email protected]
Required: No
Values: non-zero positive integer
Default: 1
The number of thumbnails you wish to request. You will be charged at a rate of 1 credit per thumbnail requested regardless of how many types of thumbnails you request, regardless of how many different types you request.
Required: No
Values: jpg OR png
Default: jpg
Format of requested thumbnails. If you use the jpg format then transparency will not be supported.
Required: No
Values: non-zero positive integer
Default: 120
The width you require for your output thumbnails.
Required: No
Values: non-zero positive integer
Default: 90
The height you require for your output thumbnails.
Required: No
Values: individual,gif,capsheet
Default: individual
Sets the style of the thumbnails multiple options can be set by separating them with commas. Examples with their corresponding thumbnail_styles values:
individual
Each thumbnail is created as an individual image.
gif
The thumbnails are combined into an animated gif, the playback speed of which can be set using
gif_framerate.
capsheet
The thumbnails are arranged on a single larger image called a "capsheet" (or capture sheet) the
number of columns, the
timestamps and the
video info are configurable.
Required: No
Values: pad OR stretch OR crop
Default: pad
Sets the method used to scale the image. Examples with their corresponding scale_mode values:
Required: No
Values: Hex color value
Default: 000000
Sets the color of the "padding" on thumbnails generated with the
scale_mode property set to "pad". Examples with their corresponding pad_color values:
default
#990000
transparent
Note: in order to generate thumbnails with transparent padding the
thumbnail_format value must be set to png
Required: No
Values: boolean
Default: true
If set to true, before your video is processed, temporary placeholder images will be uploaded to the destination, allowing you to use the thumbnails from the initial API response.
Required: No
Values: URL
Default: N/A
If set, upon failure or completion, grabb.io will call this URL with a json object stored as a POST parameter called message.
Required: No
Values: string
Default: N/A
If set, when the URL specified in the callback_url is called, the external_id will be included. This allows you to track grabbio videos using your id instead of ours. This means that you do not need to store the grabbio video_id for your request.
Required: No
Values: non-zero positive integer
Default: 30
If gif is set as a thumbnail_stype then this value will be used as the delay bertween frames.
Required: No
Values: non-zero positive integer
Default: 3
The number of columns required for the capsheet. Rows will be automatically determined based on this value and the number_of_thumbnails value.
Required: No
Values: boolean
Default: true
If true, the video information (Filesize, Filename, Width and Height) will be displayed at the top of the capsheet.
Required: No
Values: boolean
Default: true
If true, each thumbnail on the capsheet will contain a timestamp on the bottom left of the thumbnail.
Required: Yes
Values: Timestamp
Default: N/A
Your server time as a Unix timestamp. This is used to validate the time of requests from your server for security purposes.
Required: Yes
Values: String
Default: N/A
Signed hash of your parameters, signed with your private key.
Format
This is a base64_encoded string of the binary data created by the HMAC digest using sha1. If you are using one of our SDKs then this will be done for you. The parameters is the query_string excluding the "?"
The parameters string should look something like "source=http://test.com&upload;_url=s3://test&token;=grabbio&server;_time=1302526504"
The hash generated from the above string with the secret key "grabbio" should be "cixjt11NmgBIibiuCOPeIXPyIog="
Ruby
Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret_key,parameters)).chomp.gsub(/\n/,'')
PHP
base64_encode(hash_hmac("SHA1", $parameters, $secret_key, 1));