On2 Flix Cloud API Guide

Overview

Supported Input Formats

On2 Flix Cloud uses On2 Flix Engine to transcode videos, and as a result can transcode practically any input file. If you have an input file that fails to transcode, contact us at support@flixcloud.com or open a case through our Help Desk.

Supported Output Formats

Video Codecs

Codec Description
On2 VP6 The proprietary advanced video compression format used in Adobe Flash Player and JavaFX video. On2 VP6 supports two profiles, VP6-E and VP6-S. VP6-E is the general-purpose profile of VP6, suitable for all resolutions and bitrates but especially good at low data rates. VP6-S is the HD profile of VP6. The VP6-S profile uses less post-processing than VP6-E and can play HD material on less powerful legacy computers with a minimal sacrifice of quality. For more information about VP6-S, see this DSP DesignLine article.
On2 VP6 with Alpha A variant of VP6 that supports alpha compositing. A percentage of the video data is reserved in a fourth channel to preserve "transparent" regions in a video. Both VP6-E and VP6-S support alpha transparency in Flash video; H.263 and H.264 do not.
H.264 A video standard developed by the Joint Video Team (JVT), H.264 is also known as AVC and MPEG-4 Part 10. H.264 supports a wide range of applications, from mobile phones and the Apple iPhone/iPod to Adobe Flash Player (version 9.0.115.0 and later) to HD.
Windows Media Video 8 A proprietary video codec developed by Microsoft.
H.263 A legacy video format used in Adobe Flash, also known as Sorenson Spark.
H.263 Baseline A mode of H.263 that supports only the minimum features of the format, to support low-power devices such as mobile phones. Note that H.263 Baseline is not supported in Flash Player.

Audio Codecs

Codec Description
MP3 The most popular general-purpose audio format supported in Adobe Flash Player, Sun JaxaFX and nearly every consumer electronic device on the market today that can play audio streams.
AAC, HE-AAC The successor to MP3, AAC generally achieves better sound quality than MP3 at many bit rates. HE-AAC is a version of AAC that is optimized for low-bitrate applications. AAC is supported in many consumer electronic devices as well as Adobe Flash Player 9.0.115.0 and later. It is often paired with H.264 video.
AMR-NB The narrowband profile of AMR, the standard audio codec in the 3GPP standard. AMR-NB is well suited for low-bandwidth mobile applications.
Windows Media Audio 9 A proprietary audio codec developed by Microsoft.

Multimedia File Containers

Codec Description
FLV The Adobe Flash video format.
FXM The Sun JavaFX video format.
MOV, MP4 MOV is the QuickTime multimedia file container format, MP4 is the MPEG-4 format. MP4 is essentially the same as MOV. Both are supported by Adobe Flash Player 9.0.115.0 and later, Apple iPod/iPhone and many consumer electronic devices.
3GP, 3G2 A multimedia container format designed for 3G mobile phones. 3GP is the variant for GSM networks, 3G2 is for CDMA networks.
WMV A proprietary media container format developed by Microsoft.

Codecs and Container Pairings

The table below illustrates which codecs are supported (X) in each container.

  VP6 VP6 Alpha H.263 H.263 baseline H.264 baseline H.264 main H.264 high Windows Media Video 8 AAC MP3 AMR-NB PCM Windows Media Audio 9
FLV X X X X X X
MOV X X X X X
MP4 X X X X
3GPP X X X X X X
3G2 X X X X X X
WMV X X

FLV Cue Points

Flix Cloud supports adding event and navigation cue points to Flash Video (FLV) files. Cue points are embedded in the FLV stream and FLV metadata packet when you encode the FLV file. Cue points are configured via the API.

Navigation cue points can be used to let users seek to a specified part of a video file.

Event cue points can be used to perform actions in a SWF video player that are triggered at specified points during FLV playback.

Navigation cue points create a keyframe at the specified cue point location, so you can use code to move a video player's playhead to that location. You can set particular points in an FLV file where you might want users to seek. For example, your video might have multiple chapters or segments, and you can control the video by embedding navigation cue points in the video file.

For more information, see this Adobe article about cue points.

Flix Cloud API

Flix Cloud uses a REST web services API and XML documents. The API offers the following services:

Service Description
Job Request Request (initiate) a transcode job in Flix Cloud.
Job Request Error Response Response to a Job Request, indicating request failure. Returns an error report.
Job Request Success Response Response to a Job Request, indicating request success. Returns a unique job ID and job start time.
Job Notification Response Response to a Job Request, indicating job completion. Returns job processing details.
Job Status Request Request a status report on a particular job.
Job Status Response Response to a Job Status Request. Returns a processing status report.

Job Request and Job Status REST requests are sent to https://www.flixcloud.com/jobs. Responses are sent to either the default notification URL configured in your Flix Cloud account, or a custom notification URL given in your Job Request.

Security

All HTTP communication with Flix Cloud is secured using 256-bit AES encryption over SSL. To make secure connections with Flix Cloud, you must download our certificate in PEM format and install it on your HTTP server or in your cURL environment. See your server or cURL documentation for instructions on installing an SSL certificate.

Important: If you use Amazon S3 for storing input/output files, you must grant Flix Cloud access to your S3 bucket. If you are only reading input files from S3, Flix Cloud needs READ access. If you are writing files to S3, Flix Cloud needs WRITE access. The email address to use in your S3 bucket ACL is s3@flixcloud.com. For instructions, see the Amazon S3 ACL documentation.

When transferring input/output files over SFTP, the file path you specify must be the absolute path to the root of the server, not the home directory of the user you are connected as. You do not need to do this for regular FTP, however.

HTTP/HTTPS can only be used for input and watermark file locations.

Testing with the Dashboard

Flix Cloud includes a browser interface for creating individual transcoding jobs and testing your Recipes. To access the form, log in to your dashboard, click the Recipes tab and click the Test link next to the Recipe you want to use. Fill in the fields and click Create this test job.

Testing with cURL

For development testing, we find it handy to use the cURL command line tool to send job requests to Flix Cloud. The following is a sample command:

curl -H "Accept: text/xml" -H "Content-type: application/xml" \
  -d "@flixcloud_request.xml" https://www.flixcloud.com/jobs

where @flixcloud_request.xml is the file containing your XML job request. The Content-Type and Accept options are required.

The command assumes you have added the Flix Cloud SSL certificate to your curl-ca-bundle.crt file (usually in /usr/share/curl). To disable SSL certificate checking (not recommended), use a command similar to the following:

curl -k -L -H "Accept: text/xml" -H "Content-type: application/xml" \
  -d "@flixcloud_request.xml" https://www.flixcloud.com/jobs

Note the -L (redirect) option, which will allow the request to be redirected to the non-SSL port.

Job Requests

Jobs are sent to Flix Cloud using POST requests. Requests must be sent in XML format. The XML markup elements of a request are defined below.

If you want an XML schema of our job request, you can download it in Relax NG (RNG) format.

Important: All fields in the XML request are case-sensitive.

Job Authorization Failure

If your account cannot be found by the api-key passed, you will receive a 401 Unauthorized response.

Sample Job Request

Following is an example Flix Cloud job request, including all optional elements. Details for each element follow the example.

You may also download the XML job request schema in Relax NG (RNG) format.

<?xml version="1.0" encoding="UTF-8"?>
<api-request>
  <api-key>2j1l:kd3add:0:ivzf:2e1y</api-key>
  <recipe-id>14</recipe-id>
  <notification-url>http://mysite.com/notify</notification-url>
  <pass-through>
    Here is a handy message passed through from the job 
    creation request to the job completion notification!
  <pass-through>
  <cue-points>
    <event>
      <cue-point>
        <name>cuept3</name>
        <time>3.4</time>
        <parameter>
          <key>First</key>
          <value>Value1</value>
        </parameter>
        <parameter>
          <key>Second</key>
          <value>Value2</value>
        </parameter>
      </cue-point>
      <cue-point>
        <time>1.4</time>
        <name>cuept4</name>
      </cue-point>
    </event>
    <navigation>
      <cue-point>
        <name>cuept1</name>
        <time>3.4</time>
        <parameter>
          <key>First</key>
          <value>Value1</value>
        </parameter>
        <parameter>
          <key>Second</key>
          <value>Value2</value>
        </parameter>
      </cue-point>
      <cue-point>
        <name>cuept2</name>
        <time>1.4</time>
        <parameter>
          <key>First</key>
          <value>value1</value>
        </parameter>
        <parameter>
          <key>Second</key>
          <value>Value2</value>
        </parameter>
      </cue-point>
    </navigation>
  </cue-points>
  <file-locations>
    <input>
      <url>ftp://ftp.files.com/vids/input.mov</url>
      <parameters>
        <user>joe</user>
        <password>Flu44fy</password>
      </parameters>
    </input>
    <output>
      <url>s3://mybucket/output.flv</url>
    </output>
    <watermark>
      <url>http://i.files.com/assets/watermark.png</url>
    </watermark>
    <thumbnails>
      <url>s3://mybucket/thumbs/</url>
      <prefix>thumb_</prefix>
    </thumbnails> 
  </file-locations>
  <recipe-settings>
    <width>360</width>
    <keyframe_frequency>120</keyframe_frequency>
  </recipe-settings>
</api-request>

Job Request XML Elements

Required

api-request, api-key, file-locations, input, output, parameters, password, recipe-id, recipe-name, url, user

Optional

cue-point, cue-points, event, key, name, navigation, notification-url, parameter, pass-through, prefix, recipe-settings, time, thumbnails, value, watermark

api-request

   
Description The top-level container element of a request.
Parent None; top-level element in a request.
Type Container
Children api-key, file-locations, recipe-id, recipe-name, notification-url

api-key

   
Description Contains your Flix Cloud API key.
Parent api-request
Type String
Children None
Notes Your API Key is created when you open your Flix Cloud account. You can find it in the Settings tab of your Flix Cloud dashboard. It's a mixed-symbol string typically composed of letters, numerals and colon characters. Example: 2j1l:kd3agd:0:ivzf:2f1y

cue-point

   
Description Optional. Container element for event or navigation cue point parameters.
Parent event or navigation
Type Container
Children name, time, parameter
Notes Only used with FLV cue points. Multiple cue points may be added to a job.

cue-points

   
Description Optional. Container element for event and navigation FLV cue point elements.
Parent api-request
Type Container
Children event, navigation
Notes Only used with FLV recipes.

event

   
Description Optional. Container element for specifying FLV event cue point data.
Parent cue-points
Type Container
Children cue-point
Notes This element is only used with FLV cue points. An event cue point enables you to synchronize a point in time within the FLV file with an external event on the web page. The cuePoint event occurs precisely at the specified time.

file-locations

   
Description Container element for information about your files.
Parent api-request
Type Container
Children input, output, watermark

input

   
Description Container element for details about your input file. Only one input file is permitted per job request.
Parent file-locations
Type Container
Children url, parameters

key

   
Description Optional. Contains the "key" portion of a key-value pair assigned to a cue point.
Parent parameter
Type String
Children None
Notes Only used with FLV cue points.

name

   
Description Optional. Contains the assigned name of an FLV cue point.
Parent cue-point
Type String
Children None
Notes Only used with FLV cue points.
   
Description Optional. Container element for specifying FLV navigation cue point data.
Parent cue-points
Type String
Children cue-point
Notes Only used with FLV cue points. A navigation cue point allows you to seek to a particular frame in an FLV file. It creates a keyframe (I-frame) within the FLV file as near as possible to the time that you specify.

notification-url

   
Description Optional. Contains the URL where notifications for this job will be sent, overriding the notification URL set in your Flix Cloud dashboard.
Parent api-request
Type String
Children None
Notes Job notifications are sent as a RESTful HTTP PUT. The ability to customize notification URLs by job may be useful when integrating Flix Cloud with your applications.

output

   
Description Container element for details about your output file. Only one output file is permitted per job request. HTTP/HTTPS cannot be used for output files.
Parent file-locations
Type Container
Children url, parameters

parameter

   
Description Optional. Container element for key-value pairs assigned to a cue point.
Parent cue-point
Type Container
Children key, value
Notes Only used with FLV cue points.

parameters

   
Description Container element for the user credentials needed to connect to a remote file location.
Parent input, output, watermark, thumbnails
Type Container
Children For HTTP/HTTPS or FTP/SFTP, use user, password. For Amazon S3, parameters are not required.
Notes Do not confuse with the parameter element used with FLV cue points.

pass-through

   
Description Optional. Contains an arbitrary string value that is returned unmodified in the job notification. May be used for any purpose.
Parent api-request
Type string
Children none
Notes This field is optional.

password

   
Description Contains the password to use when accessing a file over HTTP/HTTPS or FTP/SFTP. Field is not used with Amazon S3.
Parent parameters
Type String
Children None
Notes Flix Cloud requires this field to be populated if using FTP/SFTP.

Important: If you use Amazon S3 for storing input/output files, you must grant Flix Cloud access to your S3 bucket. If you are only reading input files from S3, Flix Cloud needs READ access. If you are writing files to S3, Flix Cloud needs WRITE access. The email address to use in your S3 bucket ACL is s3@flixcloud.com. For instructions, see the Amazon S3 ACL documentation.

prefix

   
Description Optional. Contains a string that is prepended to the filename of each exported PNG image (thumbnail).
Parent thumbnails
Type String
Children None
Notes This element is required for jobs that generate thumbnail images.

recipe-id

   
Description Contains the numeric identifier (Recipe ID) of the encoding recipe that you want to use for this job.
Parent api-request
Type Integer
Children None
Notes You may instead use the recipe-name element (string). Do not use both recipe-id and recipe-name. Every job must have a recipe. You may create unlimited recipes in your Flix Cloud dashboard.

recipe-name

   
Description Contains the string identifier (Recipe Name) of the encoding recipe that you want to use for this job.
Parent api-request
Type integer or string
Children none
Notes You may instead use the recipe-id element (integer). Do not use both recipe-name and recipe-id. Every job must have a recipe. You may create unlimited recipes in your Flix Cloud dashboard.

recipe-settings

   
Description Optional. Container element for recipe settings that will override those of recipe-id (or recipe-name) for this job only.
Parent api-request
Type Container
Children See the section Job Recipe Settings in this guide.

time

   
Description Optional. Contains the time in seconds at which you want to create an FLV cue point in the output video.
Parent cue-point
Type Float
Children None
Notes Only used with FLV cue points. Time must be ≥ 0.0. If you assign a time parameter, you must also specify a name parameter.

thumbnails

   
Description Optional. Container element for data about where exported PNG images are to be written.
Parent file-locations
Type Container
Children url, prefix, parameters

url

   
Description Contains the URL location of an input, output, watermark or thumbnail (exported PNG image) file.
Parent input, output, watermark, thumbnails
Type String
Children None
Notes For Amazon S3, use s3://mybucketname/file.mov (N.B.: Do not include s3.amazonaws.com in the URL That hostname is implied by the s3:// pseudo-protocol).

user

   
Description Contains the username to use when accessing a file over HTTP/HTTPS or FTP/SFTP. Field is not used with Amazon S3.
Parent parameters
Type String
Children None
Notes Flix Cloud requires this field to be populated if using FTP/SFTP.

value

   
Description Optional. Contains the "value" portion of a key-value pair assigned to a cue point.
Parent parameter
Type String
Children None
Notes Only used with FLV cue points.

watermark

   
Description Optional. Container element for data about a watermark (or image overlay) file.
Parent file-locations
Type Container
Children url, parameters
Notes The file must be in PNG format and may contain alpha-channel transparency.

Job Recipe Settings

Each Job Request must include either a recipe-id or recipe-name, which associates one of the recipes you have configured in the Flix Cloud dashboard with your job. It's possible, however, to override some or all of a recipe's encoding settings at job-creation time, using the optional recipe-settings element of your api-request.

Be aware that recipes created via the Flix Cloud dashboard are validated, meaning that the dashboard won't allow you to choose incompatible settings (for example, WMV recipes don't support PNG thumbnail exporting, so the feature isn't offered as a choice). When you override recipe settings in your job request, validation cannot be performed in advance. Any errors or parameter mismatches will be immediately returned in a Job Request Error response.

Most Flix Cloud users will find that the main job request parameters and a pre-configured recipe give them all the control they need over Flix Cloud jobs.

Why Would I Need to Deviate From a Recipe?

Some Flix Cloud users build their REST job requests with programs or scripts. These users may wish to slightly adjust a recipe for a particular job, because of a special case detected at runtime. For example:

  • The deinterlacing filter might be selectively enabled for a certain input video;
  • A thumbnailing interval that works well for most input videos might need adjustment for very short videos;
  • The width:height dimensions of an input video might necessitate an adjustment to the output dimensions.

Usually, though, simply switching to an alternate recipe for special cases is much easier, and we suggest you avoid job-level recipe settings unless you have a specific need for them.

Sample recipe-settings Element

The optional recipe-settings element is a first child of api-request:

<?xml version="1.0" encoding="UTF-8"?>
<api-request>

  ...
  
  <recipe-settings>
    <width>360</width>
    <keyframe_frequency>120</keyframe_frequency>
  </recipe-settings>
  
  ...
  
</api-request>

What Can I Change With recipe-settings?

The recipe-id (or recipe-name) you choose will control the basic aspects of the encode: the container format, video codec and audio codec. recipe-settings cannot change these, but can change almost every other aspect of the recipe.

Job Recipe Settings XML Elements

All are optional, as is the recipe-settings element itself.

Video Options
Element Type Allowed Values Default Value Description
video_bit_rate integer Even number, 0..40960 Adjust the video bitrate (best effort) to this value, in kbps.
resolution string copy width height fit_within stretch copy See Resolution Parameters, below.
width integer Even number, ≤2048 Input video width Desired output width (pixels). Used in conjunction with resolution. Use values evenly divisible by 16 for best results.
height integer Even number, ≤2048 Input video height Desired output height (pixels). Used in conjunction with resolution. Use values evenly divisible by 16 for best results.
fps string copy decimate custom copy copy means preserve the source frame rate; decimate means apply the given decimation_rate; custom means apply the frame rate given in custom_fps
decimation_rate integer 0 Removes frames from the source video at this interval. Useful for dropping the rate without introducing jerkiness due to uneven frame rate.
custom_fps integer 1..60 Adjust the frame rate to this value, in fps.
watermark_usage string no default custom no no means apply no overlay image; default means apply the overlay image to the bottom-right corner of the video image; custom means position the top-left corner of the overlay image at the x,y coordinates given in watermark_x_position and watermark_y_position
watermark_x_position integer 0 Position the left edge of the overlay image x pixels from the left of the video image.
watermark_y_position integer 0 Position the top edge of the overlay image y pixels from the top of the video image.
Resolution Parameters
Parameter Value Description
copy Preserve the source file's x,y dimensions exactly.
width Means "fit to width". Provide a width value (but no height value) and an output height is calculated that preserves the source file's aspect ratio.
height Means "fit to height". Provide a height value (but no width value) and an output width is calculated that preserves the source file's aspect ratio.
stretch The width and height values you provide will be used exactly, stretching the video image as necessary.
fit_within Means (1) preserve the source file's aspect ratio and (2) scale the video to best fit within the provided width and height.
Audio Options
Element Description
audio_channels Desired number of output audio channels
audio_bit_rate Desired output audio bitrate, kbps
audio_sample_rate Desired output audio sample rate, in kHz

When changing audio encoding options via recipe-settings, ensure that the values you set for audio_channels, audio_bit_rate and audio_sample_rate are consistent with the following charts, organized by audio codec. A Job Request Error will be returned if you choose a combination of values which do not appear together in one of the rows below.

MP3 Audio
audio_channels audio_bit_rate audio_sample_rate
mono stereo 8 11.025
mono stereo 16 24 11.025 22.05
mono stereo 32 40 48 56 64 80 96 112 128 144 160 192 224 256 320 11.025 22.05 44.1
AAC Audio
audio_channels audio_bit_rate audio_sample_rate
mono 8 10 8 11.025 12
mono 12 8 11.025 12 16
mono 16 8 11.025 12 16 22.050 24
mono 20 11.025 12 16 22.050 24
mono 24 28 11.025 12 16 22.050 24 32
mono 32 11.025 12 16 22.050 24 32 44.100 48
mono 40 16 22.050 24 32 44.100 48
mono 48 56 22.050 24 32 44.100 48
mono 64 80 96 112 128 160 32 44.100 48
stereo 16 20 8 11.025 12
stereo 24 28 32 11.025 12 16 22.050 24
stereo 40 16 22.050 24 32
stereo 48 22.050 24 32
stereo 56 22.050 24 32 44.100 48
stereo 64 80 96 112 128 160 192 224 256 288 320 32 44.100 48
AAC+ Audio
audio_channels audio_bit_rate audio_sample_rate
mono stereo 8 11.025
mono stereo 16 24 11.025 22.05
mono stereo 32 40 48 56 64 80 96 112 128 144 160 192 224 256 320 11.025 22.05 44.1
AMR Narrow-band Audio
audio_channels audio_bit_rate audio_sample_rate
mono 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2 8
VP6 Options
Element Type Allowed Values Default Value Description
video_compression_mode string good best best increases encode times
video_rate_control_mode string cbr1 cbr2 vbr1 vbr2 constant bitrate | variable bitrate, 1-pass | 2-pass
video_profile string vp6e vp6s VP6-E is the standard VP6 encoder; VP6-S requires fewer system resources to decode
Advanced Options
Element Type Allowed Values Default Value Description
deinterlace string a b d b See Deinterlace Parameters, below.
keyframe_interval_type string max fixed See Keyframe Interval Type Parameters, below.
keyframe_frequency integer The frequency at which to create keyframes in the output video.
crop_bottom integer Even number Input video height (pixels) Number of pixel-rows to remove from the bottom edge of input video.
crop_left integer Even number Input video width (pixels) Number of pixel-columns to remove from the left edge of input video.
crop_top integer Even number Input video height (pixels) Number of pixel-rows to remove from the top edge of input video.
crop_right integer Even number Input video width (pixels) Number of pixel-columns to remove from the right edge of input video.
cut_start integer Number of seconds into the play time at which to start the output video.
cut_end integer Number of seconds into the play time at which to end the output video.
denoise double 0.0..1.0 0 Noise level of source video. Higher values will filter more aggressively. 0 filters adaptively.
brightness integer -255..255 0 Positive values increase and negative values decrease relative brightness. 0 = no change.
contrast integer -255..255 0 Positive values increase and negative values decrease relative contrast. 0 = no change.
hue integer -180..180 0 Positive values adjust hue toward green, negative toward red. 0 = no change.
saturation integer -255..255 0 Positive values increase and negative values decrease relative saturation. 0 = no change.
rotate integer 90 180 270 Number of degrees to rotate the output video (clockwise).
sharpen string no yes Whether or not to apply an image sharpening filter.
blur_mask_size string 3x3 5x5 Whether to use a 3x3 or 5x5 matrix when applying the blur filter.
blur_type string lowpass gauss Apply a low-pass or Gaussian blur filter.
mirror string horizontal vertical Whether to flip the output video along its horizontal or vertical axis.
Deinterlace Parameters
Parameter Value Description
a Adaptive: addresses interlacing artifacts by dropping fields algorithmically.
b 1:2:1 Blur: addresses interlacing artifacts by blurring adjacent fields together.
d Drop Field: addresses interlacing artifacts by dropping all of the odd or even fields.
Keyframe Interval Type Parameters
Parameter Value Description
max The maximum number of frames to encode before forcing a keyframe.
fixed The explicit frequency at which to encode keyframes.
PNG Image Thumbnail Options
Element Type Allowed Values Default Value Description
pngex_width integer Even number Input video width (pixels) Desired width of the exported PNG image.
pngex_height integer Even number Input video height (pixels) Desired height of the exported PNG image.
pngex_enable_alpha string true false Whether or not to preserve the input video's alpha channel data in exported PNG images.
pngex_compression_level integer 0..9 zlib compression level. 0 = no compression; 9 = maximum compression.
Thumbnail Interval Options
Element Type Allowed Values Default Value Description
pngex_export_first_frame string true false Whether or not to export the input video's first frame as a PNG image.
pngex_export_interval integer 1 The frame interval at which to export PNG images.
pngex_export_time_string string Comma-delimited list of times (in milliseconds) at which to export a PNG image.
pngex_auto_count integer 0..10000 Total number of PNG images to export, at times evenly spaced throughout the input video.
pngex_auto_start_time integer 0 0 Used with pngex_auto_end_time and pngex_auto_count. Set the timeslice start time (in milliseconds).
pngex_auto_end_time integer 0 Input video duration Used with pngex_auto_end_start and pngex_auto_count. Set the timeslice end time (in milliseconds).
pngex_auto_random_period integer 1 0 Introduce randomness into pngex_auto_count's export times. Higher values increase randomness.

Job Request Error Response

If your Job Request fails, Flix Cloud responds with a Request Error notification similar to the following:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Malformed XML received, please check the syntax of your XML</error>
</errors>

Job Request Error XML Elements

errors

   
Description The top-level container element of an error response.
Parent None
Type Container
Children error

error

   
Description Contains a textual error message.
Parent errors
Type String
Children None

Job Request Success Response

When Flix Cloud accepts a job request, it responds with a notification similar to the following:

<?xml version="1.0" encoding="UTF-8"?>
<job>
  <id type="integer">3254</id>
  <initialized-job-at type="datetime">2009-02-11T01:23:54Z</initialized-job-at>
</job>

Job Request Success XML Elements

job

   
Description Top-level Container element of a Job Request Success response.
Parent None
Type Container
Children id, initialized-job-at

id

   
Description Contains the job's numeric identifier.
Parent job
Type Integer
Children None

initialized-job-at

   
Description Contains a datetime string (UTC) in the format YYYY-MM-DDTHH:MM:SSZ, indicating when the job was created.
Parent job
Type Datetime
Children None

Job Notification Response

In order to receive notifications when a job is finished, you must supply an Update Notification URL in your account dashboard under the Settings tab. This is the URL of a script or process that is listening for and can receive the Flix Cloud notification response. Notifications are only supported over HTTP on ports 80, 443, or 5555.

Once a job is finished you should receive a PUT response similar to the example below. initialized-job-at and finished-job-at will be in UTC time using the format YYYY-MM-DDTHH:MM:SSZ.

<?xml version="1.0" encoding="UTF-8"?>
<job>
  <finished-job-at type="datetime">2009-04-10T20:13:02Z</finished-job-at>
  <id type="integer">1322</id>
  <initialized-job-at type="datetime">2009-04-10T20:05:28Z</initialized-job-at>
  <pass-through>
    Here is a handy message passed through from the job creation
    request to the job completion notification!
  </pass-through>
  <recipe-name>Flash_vp6_250</recipe-name>
  <recipe-id type="integer">172</recipe-id>
  <state>successful_job</state>
  <error-message></error-message>
  <input-media-file>
    <url>s3://flixcloud-test/movie.mov</url>
    <width>1280</width>
    <height>720</height>
    <size>9842956</size>
    <duration>10005</duration>
    <cost>1638</cost>
  </input-media-file>
  <output-media-file>
    <url>s3://flixcloud-test/encoded.flv</url>
    <width>320</width>
    <height>176</height>
    <size>3937182</size>
    <duration>10005</duration>
    <cost>844</cost>
  </output-media-file>
  <thumbnail-media-file>
    <cost>238</cost>
    <url>s3://example_bucket/42/thumbs/vid42_</url>
    <number-of-thumbnails>8</number-of-thumbnails>
    <total-size>1136712</total-size>
  </thumbnail-media-file>
  <watermark-file>
    <url>s3://flixcloud-test/watermark.png</url>
    <size>1024</size>
    <cost>1</cost>
  </watermark-file>
</job>

Job Notification XML Elements

cost, error-message, finished-job-at, height, id, initialized-job-at, input-media-file, job, number-of-thumbnails, output-media-file, pass-through, recipe-id, recipe-name, size, state, url, thumbnail-media-file, total-size, watermark-file, width

cost

   
Description Contains the calculated Flix Cloud charge for the input, output, thumbnail or watermark file(s), in millicents.
Parent input-media-file, output-media-file, thumbnail-media-file, watermark-file
Type Integer
Children None

error-message

   
Description Contains the reason for job failure.
Parent job
Type String
Children None
Notes This error condition is different from a Job Request Error. It indicates that the Job Request was accepted, but failure occurred during job processing.

finished-job-at

   
Description Contains a datetime string in UTC (using the format YYYY-MM-DDTHH:MM:SSZ) indicating when the job finished transcoding or was cancelled.
Parent job
Type Datetime
Children None

height

   
Description Contains the height of the input or output file, in pixels.
Parent input-media-file, output-media-file
Type Integer
Children None

id

   
Description Contains the numeric identifier of the job.
Parent job
Type Integer
Children None

initialized-job-at

   
Description Contains a datetime string in UTC (using the format YYYY-MM-DDTHH:MM:SSZ) indicating when the job was created.
Parent job
Type Datetime
Children None

input-media-file

   
Description Container element for input media file properties.
Parent job
Type Container
Children cost, duration, height, size, url, width

job

   
Description Top-level container element of a notification response.
Parent None
Type Container
Children error-message, finished-job-at, id, initialized-job-at, input-media-file, output-media-file, recipe-name, recipe-id, state, watermark-file

number-of-thumbnails

   
Description Contains the number (count) of thumbnail images exported with the job.
Parent thumbnail-media-file
Type Integer
Children None

output-media-file

   s3://example_bucket/42/thumbs/vid42_
Description Container element for output media file properties.
Parent job
Type Container
Children cost, duration, height, size, url, width

pass-through

   
Description Contains an arbitrary string sent in the Job Request.
Parent job
Type String
Children None

recipe-id

   
Description Contains a numeric identifier of the encoding recipe applied to the job.
Parent job
Type Integer
Children None

recipe-name

   
Description Contains a string identifier of the encoding recipe applied to this job.
Parent job
Type String
Children None

size

   
Description Contains the size of the input, output or watermark file, in bytes.
Parent input-media-file, output-media-file, watermark-file
Type Integer
Children None

state

   
Description Contains a string indicating the state of the job after attempting to transcode.
Parent job
Type String
Children None
Notes Possible values: successful_job, failed_job, cancelled_job

thumbnail-media-file

   
Description Container element for thumbnail image file properties.
Parent job
Type Container
Children cost, number-of-thumbnails, total-size, url

total-size

   
Description Contains the total size of all png thumbnail images exported, in bytes
Parent thumbnail-media-file
Type Integer
Children None

url

   
Description Contains the URL of the input, output, watermark or thumbnail file(s).
Parent job
Type String
Children None
Notes Amazon S3 locations are represented in the s3://<bucketname>/<objectname> convention.

In the case of thumbnails (exported PNG images), the URL returned includes the domain, URL path, and any filename prefix chosen in your job request. It will exclude the serialized portion of the filename. In the example s3://example_bucket/42/thumbs/vid42_0001.png, the string returned in url would be s3://example_bucket/42/thumbs/vid42_.

watermark-file

   
Description Container element for watermark image file properties.
Parent job
Type Container
Children cost, size, url

width

   
Description Contains the width of the input or output file, in pixels.
Parent job
Type Integer
Children None

Job Status Request

You can monitor the status of any job in the Job Detail page of your Dashboard, or by querying the API.

To query the API, send a GET request to http://www.flixcloud.com/jobs/<job_id>/status where <job_id> is the numeric identifier of the job whose status you want to query. Set the Accept and Content-Type headers to application/xml in the request.

You must authenticate the GET request using HTTP authentication, with your Flix Cloud API key as the password. The username can be any string.

For example, using cURL at the command line, a status query would look like this:

curl --get -H 'Accept: application/xml' -H 'Content-type: application/xml' \
  --user my_name:icen:rrg8in:0:2d19:7otj https://www.flixcloud.com/jobs/43495/status

Job Status Response

Each Job Status Request will return an XML response similar to the following:

<?xml version="1.0" encoding="UTF-8"?>
<job>
  <id type="integer">43495</id>
  <task-state>transcoding</task-state>
  <input-media-file-task>
    <task_id type="integer">162541</task_id>
    <state>success</state>
    <state type="float">100.0</state>
  </input-media-file-task>
  <transcoding-task>
    <task_id type="integer">162544</task_id>
    <state>processing</state>
    <state type="float">15.0</state>
  </transcoding-task>
  <output-media-file-task>
    <task_id type="integer">162545</task_id>
    <state>initialized</state>
    <state type="float">0.0</state>
  </output-media-file-task>
</job>

Job Status XML Elements

id, input-media-file-task, job, output-media-file-task, state, task-id, task-state

id

   
Description Contains the numeric job ID.
Parent job
Type Integer
Children None

input-media-file-task

   
Description Container element for input file task status items.
Parent job
Type Container
Children task-id, state

job

   
Description Top-level container of a Job Status response.
Parent None
Type Container
Children id, input-media-file-task, output-media-file-task, task-state, transcoding-task

output-media-file-task

   
Description Container element for output file task status items.
Parent job
Type Container
Children task-id, state

state

   
Description Contains current task state data.
Parent input-media-file-task, output-media-file-task, transcoding-task
Type String or Float
Children None
Notes Multiple state elements will be returned for each task type. When a float is returned, it represents the current completion percentage of the task. When a string is returned, it is a status message describing the current state of the task. See Response Values for state below.

task-id

   
Description Contains the internal Flix Cloud task ID.
Parent input-media-file-task, output-media-file-task, transcoding-task
Type Integer
Children None

task-state

   
Description Contains a textual indication of the overall state of a job.
Parent job
Type String
Children None

transcoding-task

   
Description Container element for transcoding tasks.
Parent job
Type Container
Children task_id, state
Response Values for state
Task Type Possible Values
Downloading Task
(input and watermark files)
failed, initialized, processing, success, waiting
Job cancelled_job, downloading_input_files, failed_job, initialized_job, notifying, successful_job, transcoding, uploading_output_files, waiting_to_download_input_files, waiting_to_notify, waiting_to_transcode, waiting_to_upload_output_files
Transcoding Task failed, initialized, processing, success, waiting
Uploading Task
(output and thumbnail files)
failed, initialized, processing, success, waiting

Cancelling Jobs

To cancel a running job, access the Jobs tab of your dashboard. Click the job number you want to cancel. When the Job Detail page opens, click the Cancel this job link in the lower-right corner of the screen.

Job cancellation can only be done via the dashboard at this time.


Document History

Date Description
October 23, 2009 Complete refactor for organizational improvement.
October 8, 2009 Added recipe-settings override functionality and list of supported elements and their constriants. Updated Relax NG (.rng) XML validation file.
July 22, 2009 Added FLV cue point elements, job status query and manual job cancelation. Replaced XSD XML schema file with Relax NG (.rng) format.
July 15, 2009 Added pass-through request and notification elements.
July 14, 2009 Added notification-url request element.
June 15, 2009 Added thumbnailing API elements, Windows Media formats
April 23, 2009 Added new input-media-file, output-media-file and watermark-media-file children.
March 16, 2009 Added TOC, cURL commands
March 3, 2009 Beta draft

Some versions of this document use images from the Tango Icon Theme set, Copyright © 2005 by the Tango Desktop Project, which is distributed under a Creative Commons Attribution-ShareAlike 2.5 license agreement.

Sample code

Sample Flix Cloud client libraries are available for download at github:
Ruby (gem) | PHP | Python | .NET

Download the API Guide

Some people prefer their API docs in PDF format.

Flix Cloud and REST

Flix Cloud uses a RESTful web services API. For more information about REST applications, see Implementing REST Web Services: Best Practices and Guidelines or The RESTWiki.