20 October 2008

Watermarking

XML format for user's API request

<?xml version="1.0"?>
<query>
    <!-- Main fields -->
    <userid><<id>></userid>
    <userkey><<key>></userkey>
    <action>[Action]</action>
    <mediaid>[MediaID]</mediaid>
    <source>[SourceFile]</source>
    <notify>[NotifyURL]</notify>
    <format>
        <!-- Format fields -->
        <output>[Output format]</output>
        <video_codec>[Video Codec]</video_codec>
        <audio_codec>[Audio Codec]</audio_codec>
        <bitrate>[Video bitrate]</bitrate>
        <audio_bitrate>[Audio bitrate]</audio_bitrate>
        <audio_sample_rate>[Audio quality]</audio_sample_rate>
        <size>[Size]</size>
        <crop_left>[Crop Left]</crop_left>
        <crop_top>[Crop Top]</crop_top>
        <crop_right>[Crop Right]</crop_right>
        <crop_bottom>[Crop Bottom]</crop_bottom>
        <thumb_time>[Thumb time]</thumb_time>
        <thumb_size>[Thumb size]</thumb_size>
        <add_meta>[yes/no]</add_meta>
        <!-- Destination fields -->
        <destination>[DestFile]</destination>
        <thumb_destination>[Thumb Dest]</thumb_destination>
        <!-- Logo fields (OPTIONAL) -->     
        <logo>
                <logo_source>[LogoURL]</logo_source>
                <logo_x>[LogoLeft]</logo_x>     
                <logo_y>[LogoTop]</logo_y>                      
        </logo>
    </format>
</query>
{
    "query": {
        "userid": "<<id>>",
        "userkey": "<<key>>",
        "action": "[Action]",
        "mediaid": "[MediaID]",
        "source": "[SourceFile]",
        "notify": "[NotifyURL]",
        "format": {
            "output": "[Output format]",
            "video_codec": "[Video Codec]",
            "audio_codec": "[Audio Codec]",
            "bitrate": "[Video bitrate]",
            "audio_bitrate": "[Audio bitrate]",
            "audio_sample_rate": "[Audio quality]",
            "size": "[Size]",
            "crop_left": "[Crop Left]",
            "crop_top": "[Crop Top]",
            "crop_right": "[Crop Right]",
            "crop_bottom": "[Crop Bottom]",
            "thumb_time": "[Thumb time]",
            "thumb_size": "[Thumb size]",
            "add_meta": "[yes/no]",
            "destination": "[DestFile]",
            "thumb_destination": "[Thumb Dest]",
            "logo": {
                "logo_source": "[LogoURL]",
                "logo_x": "[LogoLeft]",
                "logo_y": "[LogoTop]"
            }
        }
    }
}

Logo fields

Format NameDescriptionAllowed ValuesDefault Values
logo_source[required] - The URL of the logo image. The image format can be GIF, JPG or PNG.http://[user]:[password]@ [server]/[path]/[filename], ftp://[user]:[password]@[server]/[path]/[filename][?passive=yes], sftp://[user]:[password]@[server]/[path]/[filename],None
logo_xleft offset of logo imagenon-negative integer10
logo_ytop offset of logo imagenon-negative integer10

Additional S3 Options

Main fields

UserID – an unique user identifier. Can be taken from user's page.

UserKey – user's key string. Creates automatically when user created and can be changed by user.

Action – the action to be performed.

  • AddMedia – add new media to user's media list, creates new items in a queue according to formats specified in XML
  • AddMediaBenchmark - add new media to user's media list and set a flag for NOT processing it after downloading. Format fields could be specified as well. If NotifyURL is set, a notification will be sent after the media will have been ready for processing.
  • UpdateMedia – replace information about existing media's formats. All old format items will be deleted, and the new ones added.
  • ProcessMedia - start encoding of previously downloaded media (one that added with AddMediaBenchmark action)
  • CancelMedia – delete specified media and all its items in queue
  • GetMediaList – return list of user's media
  • GetStatus – return information about selected user's media and all its items in queue
  • GetMediaInfo - returns some video parameters of the specified media, if available

MediaID – an unique identifier of media. This field must be specified for the following actions: UpdateMedia, CancelMedia, GetStatus.

SourceFile – media source file. It can be in the following formats: http://[user]:[password]@ [server]/[path]/[filename] or ftp://[user]:[password]@[server]/[path]/[filename] or sftp://[user]:[password]@[server]/[path]/[filename] or http://[AWS_KEY:AWS_PWD@][bucket].s3.amazonaws.com/[filename] – If you need your S3 files to be accessed with your own AWS credentials, add your AWS key/secret to the URL. Note: do not forget to encode your AWS_SECRET, specifically replace '/ ' with '%2F'. If you don't specify AWS key/secret, the object must have READ permission for AWS user 1a85ad8fea02b4d948b962948f69972a72da6bed800a7e9ca7d0b43dc61d5869 (or for all users). See http://docs.amazonwebservices.com/AmazonS3/latest/dev/ACLOverview.html#SpecifyingGrantee for details. This field must be specified only for AddMedia and AddMediaBenchmark actions.

NotifyURL – could be either an HTTP(S) URL of the script the result would be posted to, or a mailto: link with email address the result info to be sent. This field may be specified for AddMedia and AddMediaBenchmark actions.

 

...

 

Destination fields 

Format NameDescriptionAllowed ValuesDefault Values
destinationThe destination URL to put the encoded file.ftp://[user]:[password]@[server]/[path]/[filename][?passive=yes],sftp://[user]:[password]@[server]/[path]/[filename],http://[AWS_KEY:AWS_SECRET@][bucket].s3.amazonaws.com/[filename]?acl=public-readauthenticated-read] - If you need your S3 files to be accessed with your own AWS credentials, add your AWS key/secret to the URL.Note: do not forget to encode your AWS_SECRET, specifically replace '/ ' with '%2F'.If you don't specify AWS key/secret, the bucket must have WRITE permission for AWS user 1a85ad8fea02b4d948b962948f69972a72da6bed800a7e9ca7d0b43dc61d5869, See http://docs.amazonwebservices.com/AmazonS3/latest/dev/ACLOverview.html#SpecifyingGrantee for details.Also, you can add ?acl=public-read OR ?acl=authenticated-read after the filename. This will explicitly set access rights to the saved object instead of the default settings.
thumb_destinationThe destination URL to put the thumbnail.ftp://[user]:[password]@[server]/[path]/[filename], http://[AWS_KEY:AWS_SECRET@][bucket].s3.amazonaws.com/[filename]None