15 July 2008

Multiple Thumbnail Support

Instead of using thumb_ parameters within , you can specify separate encoding task with output = thumbnail:

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <format>
        <!-- Format fields -->
        <output>thumbnail</output>
        <time>[Size]</time>     
        <width>[Width]</width>
        <height>[Size]</height>
        <!-- Destination fields -->
        <destination>[DestFile]</destination>
        <!-- ... -->
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[Action]",
        "format": {
            "output": "thumbnail",
            "time": "[Size]",
            "width": "[Width]",
            "height": "[Size]",
            "destination": "[DestFile]"
        }
    }
}

With the following specific parameters:

Format NameDescriptionAllowed ValuesDefault Values
timeTimestamp (in seconds) to capture thumbnail.Non-negative integer or hh:mm:ss.ms5
widthThumbnail width (in pixels)Non-negative integernone
heightThumbnail height (in pixels)Non-negative integernone

destination  — The destination URL to put the thumbnail.

If you specify both width and height, you'll get a thumbnail with these dimensions, and if your video have another aspect ratio than the thumbnail, black spaces will be added to the picture.

If you specify only one parameter from this pair, the other one will be calculated according to your video size.

If none of those parameters specified, the thumbnail will have the same size as your video have.

Now only JPEG format is supported for thumbnails.

AddMedia action response

<?xml version="1.0"?>
<response>
    <message>Added</message>
    <MediaID>[MediaID]</MediaID>
</response>
{
    "response": {
        "message": "Added",
        "mediaid": "[MediaID]"
    }
}