Overview of All Available Robots

Our Robots import, convert and store your files, and each Assembly Step uses one Robot. You can set parameters in your Assembly Step that define what each Robot does with your files.

Name Description Documentation

1.1 Handling Uploads

/upload/handle This Robot receives uploads that your users throw at you from browser or apps, or that you throw at us programatically Documentation

1.2 File Importing

/dropbox/import This Robot imports whole directories of files from your Dropbox Documentation
/ftp/import This Robot imports whole libraries of files from your FTP servers into Transloadit. No public key authentication is required. This Robot relies on password access Documentation
/http/import This Robot imports any file that is publicly available via a web URL into Transloadit Documentation
/s3/import This Robot imports whole directories of files from your S3 bucket Documentation
/sftp/import This Robot imports whole libraries of files from your SFTP servers into Transloadit. This Robot relies on public key authentication Documentation

1.3 Video Encoding

/video/adaptive This Robot encodes videos into HTTP Live Streaming (HLS) and MPEG-Dash supported formats and generates the necessary manifest and playlist files Documentation
/video/concat This Robot concatenates several videos together Documentation
/video/encode This Robot encodes, resizes, applies watermarks to videos and animated GIFs Documentation
/video/merge This Robot composes a new video by adding an audio track to existing still image(s) or video Documentation
/video/subtitle This Robot adds subtitles to videos Documentation
/video/thumbs This Robot extracts any number of images from videos for use as previews Documentation

1.4 Audio Encoding

/audio/artwork This Robot extracts the embedded cover artwork from audio files and allows you to pipe it into other Steps, for example into /image/resize Steps. It can also insert images into audio files as cover artwork Documentation
/audio/concat This Robot concatenates several audio files together Documentation
/audio/encode This Robot converts audio files into all kinds of formats for you. We provide encoding presets for the most common formats Documentation
/audio/loop This Robot loops one audio file as often as is required to match a given duration Documentation
/audio/merge This Robot overlays several audio files on top of each other Documentation
/audio/waveform This Robot generates waveform images for your audio files and allows you to change their colors and dimensions Documentation

1.5 Image Manipulation

/image/optimize This Robot reduces the size of images while maintaining the same visual quality Documentation
/image/resize This Robot resizes, crops, changes colorization, rotation, and applies text and watermarks to images Documentation

1.6 Computer Vision

/image/facedetect This Robot detects faces in images and returns their coordinates, or cuts them from the original images and returns those as new images Documentation

1.7 Document Processing

/document/convert This Robot converts documents into different formats Documentation
/document/thumbs This Robot generates an image for each page in a PDF file or an animated gif file that loops through all pages Documentation
/html/convert This Robot takes screenshots of web pages or uploaded HTML pages Documentation

1.8 File Filtering

/file/filter This Robot is a gatekeeper that can direct files to different encoding Steps based on your conditions Documentation
/file/virusscan This Robot rejects millions of trojans, viruses, malware & other malicious threats before they reach your platform Documentation

1.9 Media Cataloging

/media/playlist This Robot merges segment files to generate playlist files for HTTP Live Streaming (HLS) Documentation
/meta/write This Robot writes meta data into any file that supports it Documentation

1.10 File Compressing

/file/compress This Robot creates archives of files or file conversion results Documentation
/file/decompress This Robot extracts entire archives of files to be consumed by other Robots or exported as individual files Documentation

1.11 File Exporting

/azure/store This Robot exports encoding results to Microsoft Azure Documentation
/cloudfiles/store This Robot exports encoding results to Rackspace Cloudfiles Documentation
/dropbox/store This Robot exports encoding results to Dropbox Documentation
/ftp/store This Robot exports encoding results to your FTP servers. No public key authentication is required. This Robot relies on password access Documentation
/google/store This Robot exports encoding results to Google Storage Documentation
/s3/store This Robot exports encoding results to Amazon S3 Documentation
/sftp/store This Robot exports encoding results to your own SFTP server Documentation
/softlayer/store This Robot exports encoding results to Softlayer / IBM Cloud Documentation
/youtube/store This Robot exports encoding results to YouTube Documentation

1 Handling Uploads

1.1 Handle uploads

The /upload/handle Robot receives uploads that your users throw at you from browser or apps, or that you throw at us programatically.

Transloadit will handle file uploads for you wether you specify this Robot or not, so using it is optional.

It can still be good to define this Robot to make your Assembly Instructions explicit though, and to configure how exactly uploads should be handled. For example, what meta data we should extract for uploaded files?

There are three constraints when using this Robot, you must:

  • not define a use parameter, contrary to all other Robots
  • only use it once in a single set of Assembly Instructions
  • name the Step that it's used in: :original

For example:

{
  "steps": {
    ":original": {
      "robot": "/upload/handle",
      "output_meta": {
        "has_transparency": true
      }
    },
    "exported": {
      "robot": "/s3/store",
      "use": ":original",
      "credentials": "YOUR_S3_CREDENTIALS"
    }
  }
}

Parameters

Name Type Default Description
output_meta Object {} Allows you to specify a set of meta data that is more expensive on cpu power to calculate, and thus is disabled by default to keep your Assemblies processing fast. You can add "has_transparency": true in this object to extract if uploaded images contain transparent parts.

Examples featuring the /upload/handle Robot

2 File Importing

2.1 Import files from Dropbox

The /dropbox/import Robot imports whole directories of files from your Dropbox.

Since you need to provide credentials to this robot, please always use this together with Templates, to hide your Assembly Instructions

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your access token. Please create your dropbox access token here. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameter instead: "access_token".
path (required) String / Array of Strings The path in your dropbox to the specific file or directory. If the path points to a file, only this file will be imported. For example: js/my_javascript_file.js If it points to a directory, then all files from this directory will be imported. For example: js/ For Transloadit to recognize you want to import all files from a directory, make sure your path ends with a / slash. Directories are imported recursively. If you want to import all files from the root directory, please use / as the value here. You can also use an array of path strings here to import multiple paths in the same Robot Step.
ignore_errors Boolean false There might be an error coming up when trying to extract meta data from your imported files. This happens for files that are zero bytes big for example. Setting this to true will cause the Robot to not stop the import (and the entire Assembly) when that happens.

Examples featuring the /dropbox/import Robot

2.2 Import files from FTP servers

The /ftp/import Robot imports whole libraries of files from your FTP servers into Transloadit. No public key authentication is required. This Robot relies on password access.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your FTP host, user and password. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "host", "user", "password".
path (required) String The path on your FTP server where to search for files. Files are imported recursively from all sub-directories and sub-sub-directories (and so on) from this path.
ignore_errors Boolean false There might be an error coming up when trying to extract meta data from your imported files. This happens for files that are zero bytes big for example. Setting this to true will cause the Robot to not stop the import (and the entire Assembly) when that happens.
passive_mode Boolean true Determines if passive mode should be used for the FTP connection.

Things to Keep in Mind

  • Your server might be unresponsive from time to time. Since (S)FTP servers are harder to scale, we have seen this happen a lot. As a result, if this robot fails to store one of your files, it retries to store the file 5 times over 15 minutes.
  • This also means that when you gave it the wrong credentials (when testing for example) Assemblies can take up to 15min to complete. Please keep this in mind.
  • If an Assembly has an export Step and takes long to execute, it is almost always due to the export Step having wrong credentials or the server being unreachable.

We advise you to use our /sftp/store and /sftp/import Robots when possible, as it is much more secure. The FTP Robots should only serve as a fallback for when SFTP cannot be used.

Examples featuring the /ftp/import Robot

2.3 Import files from webservers

The /http/import Robot imports any file that is publicly available via a web URL into Transloadit.

The result of this Robot will carry a field import_url in their metadata, which references the URL from which they were imported. Further conversion results that use this file will also carry this import_url field. This allows you to to match conversion results with the original import URL that you used.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
url (required) String / Array of Strings The URL from which the file to be imported can be retrieved. You can also specify an array of URLs or a string of | delimited URLs to import several files at once. Please also check the url_delimiter parameter for that.
url_delimiter String "|" Provides the delimiter that is used to split the URLs in your url parameter value.
headers Array of Strings [] Custom headers to be sent for file import. This is an empty array by default, such that no additional headers expect the necessary ones (e.g. Host) are sent.
force_name String / Null null Custom name for the imported file. Defaults to null, which means the file name is derived from the supplied URL.
ignore_errors Boolean false There might be an error coming up when importing files or trying to extract meta data from them. Setting this to true will cause the Robot to not stop the import (and the entire Assembly) when that happens. This is especially useful when you use an array of URLs for the url parameter and thereby import several files at once.

Examples featuring the /http/import Robot

2.4 Import files from Amazon S3

The /s3/import Robot imports whole directories of files from your S3 bucket.

Since you need to provide credentials to this robot, please always use this together with Templates, to hide your Assembly Instructions

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your S3 bucket, key, secret and bucket region. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "bucket", "bucket_region" (for example: "us-east-1" or "eu-west-2"), "key", "secret".
path (required) String / Array of Strings The path in your bucket to the specific file or directory. If the path points to a file, only this file will be imported. For example: js/my_javascript_file.js If it points to a directory, then all files from this directory will be imported. For example: js/ For Transloadit to recognize you want to import all files from a directory, make sure your path ends with a / slash. Directories are not imported recursively. If you want to import files from subfolders and sub-subfolders, please do this with another Robot Step. If you want to import all files from the root directory, please use / as the value here. In this case, make sure all your objects belong to a path. If you have objects in the root of your bucket that aren't prefixed with /, you'll receive an error: A client error (NoSuchKey) occurred when calling the GetObject operation: The specified key does not exist. You can also use an array of path strings here to import multiple paths in the same Robot Step.
ignore_errors Boolean false There might be an error coming up when trying to extract meta data from your imported files. This happens for files that are zero bytes big for example. Setting this to true will cause the Robot to not stop the import (and the entire Assembly) when that happens.

Examples featuring the /s3/import Robot

2.5 Import files from SFTP servers

The /sftp/import Robot imports whole libraries of files from your SFTP servers into Transloadit. This Robot relies on public key authentication.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your SFTP host, user and optional custom public key. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "host", "port", "user", "public_key" (optional).
path (required) String The path on your SFTP server where to search for files.
ignore_errors Boolean false There might be an error coming up when trying to extract meta data from your imported files. This happens for files that are zero bytes big for example. Setting this to true will cause the Robot to not stop the import (and the entire Assembly) when that happens.
port Integer 22 The port to use for the connection.

Things to Keep in Mind

  • Your server might be unresponsive from time to time. Since (S)FTP servers are harder to scale, we have seen this happen a lot. As a result, if this robot fails to store one of your files, it retries to store the file 5 times over 15 minutes.
  • This also means that when you gave it the wrong credentials (when testing for example) Assemblies can take up to 15min to complete. Please keep this in mind.
  • If an Assembly has an export Step and takes long to execute, it is almost always due to the export Step having wrong credentials or the server being unreachable.

This robot uses SSH keys, which is more secure at the trade-off of a bit of complexity in setting up. If you prefer a less secure, but easier-to-setup solution, then please have a look at our /ftp/store and /ftp/import Robots.

Installation on Your Server

The method explained here is slightly more elaborate than handing out an SSH account with an authorized public key, but is more secure, as the user will not be able to traverse outside their home directory. This way, even if the user account is compromised at some point, the accessible data would be recently uploaded files.

The following explains how to create a dedicated user and group for Transloadit, and restrict access as shown in this article.

First let's create a dedicated group & user:

# Change these variables to suit your needs.
# For additional security, use a randomly picked username.
TL_USER="random873"
TL_PUBLIC_PATH="uploads"

groupadd sftponly
useradd -g sftponly -m ${TL_USER}

# This line sets a random 20-character password for the user.
# We work with keys, but this is required because some operating systems will
# consider the account locked without one.
echo "${TL_USER}:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c20)" |chpasswd

mkdir -p /home/${TL_USER}/.ssh /home/${TL_USER}/${TL_PUBLIC_PATH}

echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA57GdwNLqsWz03X8MBEe4KoMSY2HOURjnUUe9zeTivASI+BLEe3cZcuJjsEBaRpISvCH04hosWUI0H4BQeB1dZZUUW1s4ttnVohCD9CfNiXJ7pwJAvgWb01dTW4YUWFKUTpTeUwQzgcNVLDtSVaQOYh4lAKvCZEcz17X9iZ7AeSEuQKe+QsrcwQoBdSpQ6FnzKwSZsggK81dPiGIW9Cw2z/EZWJpl9QBTYhw25NbNRtZj3fXVbrejnQQ985eZ6TlrvQFpUVwyk0QNHDsN+7zVISM3eXNpxof+vJyQNDLN9tb8vNPf/HXuw7MDJWMphrQevF5V26aMzszl3ZeO1779Mw== sftp@transloadit.com" >> /home/${TL_USER}/.ssh/authorized_keys

chown -R ${TL_USER}.sftponly /home/${TL_USER}
chown root.root /home/${TL_USER}

chmod -R 600 /home/${TL_USER}/.ssh /home/${TL_USER}/${TL_PUBLIC_PATH}
chmod -R u+X /home/${TL_USER}/.ssh /home/${TL_USER}/${TL_PUBLIC_PATH}

Make sure to change ${TL_USER} and ${TL_PUBLIC_PATH} to suit your needs. Remember to use a random username for additional security.

Next, we will set up SSH to cage SFTP users in their home directory, and deny them regular shell access.

Enter ${EDITOR} /etc/ssh/sshd_config, and then find and comment out this line:

# Subsystem sftp /usr/lib/openssh/sftp-server

At the bottom of the same file, add the following:

Subsystem sftp internal-sftp

Match group sftponly
    ChrootDirectory /home/%u
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp

Finally, enter /etc/init.d/ssh restart to reflect the changes made.

Examples featuring the /sftp/import Robot

3 Video Encoding

3.1 Convert videos to HLS and MPEG-Dash

The /video/adaptive Robot encodes videos into HTTP Live Streaming (HLS) and MPEG-Dash supported formats and generates the necessary manifest and playlist files.

The /video/adaptive Robot generates the necessary manifest and playlist files based on a set of used video and audio files to make implementing HTTP Live Streaming (HLS) and MPEG-Dash streaming easy.

This Robot accepts all types of video files and audio files. Do not forget to use Step bundling in your use parameter to make the Robot work on several input files at once.

We have implemented video and audio encoding presets specifically for MPEG-Dash and HTTP Live Streaming support. These presets are prefixed with "dash" and "hls".

We deem this Robot ready for production, but since it hasn't seen a lot of such traffic yet, it's still labeled as beta.

Required CORS settings for MPEG-Dash

Playing back MPEG-Dash Manifest files requires CORS definitions on your Amazon S3 Bucket or other storage location. For convenience here you can find a working CORS definition:

<CORSConfiguration>
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <ExposeHeader>Access-Control-Allow-Origin</ExposeHeader>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

To set up CORS for your S3 bucket:

  1. Visit: https://s3.console.aws.amazon.com/s3/buckets/
  2. Click on your bucket
  3. Click "Permissions"
  4. Click "CORS configuration"

Required CORS settings for HTTP Live Streaming

Playing back HLS playlist files may require a crossdomain policy file. For convenience here you can find a working file.

Please save this to a crossdomain.xml file and store it in the root folder of your Amazon S3 Bucket or other storage location of choice.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" secure="false" />
  <allow-http-request-headers-from domain="*" headers="*" />
</cross-domain-policy>

Storing Segments and Playlist files

The Robot gives its result files (segments, initialization segments, MPD manifest files and M3U8 playlist files) the right meta data property relative_path, so that you can store them easily using one of our storage Robots.

In the path parameter of the storage Robot of your choice, please use the Assembly Variable ${file.meta.relative_path} to store files in the proper paths to make the playlist files work.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
technique String "dash" Determines which streaming technique should be used. Currently supports "dash" for MPEG-Dash and "hls" for HTTP Live Streaming.
playlist_name String "playlist.mpd" The filename for the generated manifest/playlist file. The default is "playlist.mpd" if your technique is "dash", and "playlist.m3u8" if your technique is "hls".
segment_duration Integer 10 The duration for each segment in seconds.
closed_captions Boolean true Determines whether you want closed caption support when using the "hls" technique.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Video Encoding Presets.

Examples featuring the /video/adaptive Robot

3.2 Concatenate videos

The /video/concat Robot concatenates several videos together.

Important All videos that you concatenate must have the same dimensions (width and height), and the same streams (audio and video streams) otherwise you will run into errors! If your videos do not have the desired dimensions when passing them to the /video/concat Robot, please encode them first into the proper dimensions with our /video/encode Robot. If your one of your videos has no audio stream, but the other ones have one, then please first add a /video/merge Step where you add a silent audio stream to the ones that don't have an audio stream.

It is possible to concatenate a virtually infinite number of video files using the /video/concat Robot.

Imagine you have three file input fields in the same upload form for video files that you want to concatenate. You can tell Transloadit in which order it should concatenate them using the file input field's name attribute. Just use the value for the name attribute as the value for the fields key in the JSON. Then set the proper order values in the as parameter. Valid values here are video_[[index]]. Transloadit will then concatenate them in the order of the index ascending:

"concatenated": {
  "robot": "/video/concat",
  "preset": "ipad-high",
  "use": {
    "steps": [
      { "name": ":original", "fields": "first_video_file", "as": "video_1" },
      { "name": ":original", "fields": "second_video_file", "as": "video_2" },
      { "name": ":original", "fields": "third_video_file", "as": "video_3" }
    ]
  }
}

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "flash" Performs conversion using pre-configured settings. If you specify your own FFmpeg parameters using the Robot's ffmpeg parameter and you have not specified a preset, then the default "flash" preset is not applied. This is to prevent you from having to override each of the flash preset's values manually. For a list of video presets, see video presets.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Video Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg documentation. Options specified here take precedence over the preset options.

Examples featuring the /video/concat Robot

3.3 Transcode, resize, or watermark videos

The /video/encode Robot encodes, resizes, applies watermarks to videos and animated GIFs.

On Watermarking

With watermarking you can add an image to a video. This is usually used for logos, but you could also Surround a video with a frame if you cut out a transparent center from your image.

Supplying the Watermark via an Assembly Step

It is now possible to pass both the video and the watermark image to an Assembly Step via the use parameter, allowing you to either have both be part of the upload or to use results of other Assembly Steps as input to your /video/encode Step.

For this to work you just need to use the as-syntax:

"my_video_step": {
  "robot": "/video/encode",
  "use": {
    "steps": [
      { "name": ":original", "as": "video" },
      { "name": ":original", "as": "watermark" }
    ]
  }
}

Here both the video and the watermark image are taken from the uploaded files. They are recognized automatically based on their file type.

If you use several file input fields, then you can tell Transloadit which field supplies the base video and which the watermark. Suppose you have two file input fields named the_video and the_watermark. These Assembly Instructions will make it work using the fields condition:

"my_video_step": {
  "robot": "/video/encode",
  "use": {
    "steps": [
      { "name": ":original", "fields": "the_video", "as": "video" },
      { "name": ":original", "fields": "the_watermark", "as": "watermark" }
    ]
  }
}

Please note that the Robot's watermark_url parameter will still continue to work.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "flash" Converts a video according to pre-configured settings. If you specify your own FFmpeg parameters using the Robot's ffmpeg parameter and you have not specified a preset, then the default "flash" preset is not applied. This is to prevent you from having to override each of the flash preset's values manually. For a list of video presets, see video presets.
width Integer(1-1920) Width of the input video Width of the new video, in pixels.
height Integer(1-1080) Height of the input video Height of the new video, in pixels.
resize_strategy String "pad" See the available resize strategies.
background String "00000000" The background color of the resulting video the "rrggbbaa" format (red, green, blue, alpha) when used with the "pad" resize strategy. The default color is black.
rotate Integer Auto Forces the video to be rotated by the specified degree integer. Currently, only multiples of 90 are supported. We automatically correct the orientation of many videos when the orientation is provided by the camera. This option is only useful for videos requiring rotation because it was not detected by the camera. If you set rotate to false no rotation is performed, even if the metadata contains such instructions.
hint Boolean false Enables hinting for mp4 files, for RTP/RTSP streaming.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Video Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. For available options, see the FFmpeg documentation. If a preset is used, the options specified are merged on top of the ones from the preset. The FFmpeg r parameter (framerate) has a default value of 25 and maximum value of 60. If you use ffmpeg_stack "v2.0.0" or higher, and set r to null, you clear the default of 25 and can preserve the original video's framerate. For example:
"steps": {
  "video_encode": {
    "robot": "/video/encode",
    "use": ":original",
    "ffmpeg_stack": "v2.2.3",
    "preset": "iphone-high",
    "ffmpeg": {
      "b": "600k"
    }
  }
}

Watermarking Parameters

Name Type Default Description
watermark_url String "" A URL indicating a PNG image to be overlaid above this image. Please note that you can also supply the watermark via another Assembly Step.
watermark_position String / Array of Strings "center" The position at which the watermark is placed. The available options are "center", "top", "bottom", "left", and "right". You can also combine options, such as "bottom-right". An array of possible values can also be specified, in which case one value will be selected at random, such as [ "center", "left", "bottom-left", "bottom-right" ]. This setting puts the watermark in the specified corner. To use a specific pixel offset for the watermark, you will need to add the padding to the image itself.
watermark_x_offset Integer 0 The x-offset in number of pixels at which the watermark will be placed in relation to the position it has due to watermark_position. Values can be both positive and negative and yield different results depending on the watermark_position parameter. Positive values move the watermark closer to the image's center point, whereas negative values move the watermark further away from the image's center point.
watermark_y_offset Integer 0 The y-offset in number of pixels at which the watermark will be placed in relation to the position it has due to watermark_position. Values can be both positive and negative and yield different results depending on the watermark_position parameter. Positive values move the watermark closer to the image's center point, whereas negative values move the watermark further away from the image's center point.
watermark_size String "" The size of the watermark, as a percentage, such as "50%". How the watermark is resized greatly depends on the watermark_resize_strategy.
watermark_resize_strategy String "fit" Available values are "fit", "stretch" and "area". To explain how the resize strategies work, let's assume our target video size is 800×800 pixels and our watermark image is 400×300 pixels. Let's also assume, the watermark_size parameter is set to "25%". For the "fit" resize strategy, the watermark is scaled so that the longer side of the watermark takes up 25% of the corresponding video side. And the other side is scaled according to the aspect ratio of the watermark image. So with our watermark, the width is the longer side, and 25% of the video size would be 200px. Hence, the watermark would be resized to 200×150 pixels. If the watermark_size was set to "50%"", it would be resized to 400×300 pixels (so just left at its original size). For the "stretch" resize strategy, the watermark image is stretched (meaning, it is resized without keeping its aspect ratio in mind) so that both sides take up 25% of the corresponding video side. Since our video is 800×800 pixels, for a watermark size of 25% the watermark would be resized to 200×200 pixels. Its height would appear stretched, because keeping the aspect ratio in mind it would be resized to 200×150 pixels instead. For the "area" resize strategy, the watermark is resized (keeping its aspect ratio in check) so that it covers "xx%" of the video's surface area. The value from watermark_size is used for the percentage area size.
watermark_start_time float 0.0 The delay in seconds from the start of the video for the watermark to appear. By default the watermark is immediately shown.
watermark_duration float -1.0 The duration in seconds for the watermark to be shown. Can be used together with watermark_start_time to create nice effects. The default value is -1.0, which means that the watermark is shown for the entire duration of the video.
watermark_opacity float 1.0 The opacity of the watermark. Valid values are between 0 (invisible) and 1.0 (full visibility).

HLS Parameters

This Robot used to support HLS parameters but we now recommend using our specialized /video/adaptive Robot instead.

Examples featuring the /video/encode Robot

3.4 Merge video, audio, images into one video

The /video/merge Robot composes a new video by adding an audio track to existing still image(s) or video.

This Robot is able to generate a video from:

  • an image and an audio file
  • a video and an audio file
  • several images

Merging an Audio File and an Image

To merge an audio file and an image to create a video please pass both the audio file and the image to an Assembly Step via the use parameter. For this to work you just need to use the as-syntax:

"my_merge_step": {
  "robot": "/video/merge",
  "preset": "ipad-high",
  "use": {
    "steps": [
      { "name": ":original", "as": "audio" },
      { "name": ":original", "as": "image" }
    ]
  }
}

Imagine you have uploaded both an image and an audio file in the same upload form. In the above example the system will automatically recognize the files properly if you use the same Step name twice (":original" in this case). Instead of using :original you could also use any other valid Assembly Step name.

If you are using multiple file input fields, then you can tell Transloadit which field supplies the audio file and which supplies the image. Suppose you have two file input fields named the_image and the_audio. These Assembly Instructions will make it work:

"my_merge_step": {
  "robot": "/video/merge",
  "preset": "ipad-high",
  "use": {
    "steps": [
      { "name": ":original", "fields": "the_audio", "as": "audio" },
      { "name": ":original", "fields": "the_image", "as": "image" }
    ]
  }
}

Merging an Audio File and a Video

If you have a video file (without sound for example) and an audio track that you want the video to use you can merge them together with Transloadit. Just label the video as video and the audio file as audio using the as key in the JSON.

Imagine you have two file input fields in the same upload form - one to upload a video file and one for an audio file. You can tell Transloadit which field supplies the video and which the audio file using the file input field's name attribute. Just use the value for the name attribute as the value for the fields key in the JSON:

"my_merge_step": {
  "robot": "/video/merge",
  "preset": "ipad-high",
  "use": {
    "steps": [
      { "name": ":original", "fields": "the_video", "as": "video" },
      { "name": ":original", "fields": "the_audio", "as": "audio" }
    ]
  }
}

You can also supply the video and audio file using other Assembly Steps of course and leave out the fields attribute.

Important when merging audio and video files, it's recommended to set target a format & codecs via a preset or via ffmpeg.codec:v, ffmpeg.codec:a and ffmpeg.f. If not, merging will default to backwards compatible, but non-desirable legacy codecs.

Merging Several Images to Generate a Video

It is possible to create a video from images with Transloadit. Just label all images as image using the as key in the JSON:

"my_merge_step": {
  "robot": "/video/merge",
  "preset": "ipad-high",
  "use": {
    "steps": [
      { "name": ":original", "as": "image" }
    ]
  },
  "framerate": "1/10",
  "duration": 8.5
}

This will work fine in a multi-file upload context. Files are sorted by their basename. So if you name them 01.jpeg and 02.jpeg, they will be merged in the correct order.

You can also supply your images using other Assembly Steps of course, results from /image/resize Steps for example.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "flash" Generates the video according to pre-configured video presets. If you specify your own FFmpeg parameters using the Robot's ffmpeg parameter and you have not specified a preset, then the default "flash" preset is not applied. This is to prevent you from having to override each of the flash preset's values manually.
width Integer(1-1920) Width of the input image Width of the generated video, in pixels.
height Integer(1-1080) Height of the input image Height of the generated video, in pixels.
resize_strategy String "pad" If the given width/height parameters are bigger than the input image's dimensions, then the resize_strategy determines how the image will be resized to match the provided width/height. See the available resize strategies.
background String "00000000" The background color of the resulting video the "rrggbbaa" format (red, green, blue, alpha) when used with the "pad" resize strategy. The default color is black.
framerate String "1/5" When merging images to generate a video this is the input framerate. A value of "1/5" means each image is given 5 seconds before the next frame appears (the inverse of a framerate of "5"). Likewise for "1/10", "1/20", etc. A value of "5" means there are 5 frames per second.
duration Float 5.0 When merging images to generate a video this is the desired target duration in seconds. The float value can take one decimal digit. If you want all images to be displayed exactly once, then you can set the duration according to this formula: duration = numberOfImages / framerate. This also works for the inverse framerate values like 1/5. If you set this value to null, then the duration of the input audio file will be used.
audio_delay Float 0.0 When merging a video and an audio file, and when merging images and an audio file to generate a video, this is the desired delay in seconds for the audio file to start playing. Imagine you merge a video file without sound and an audio file, but you wish the audio to start playing after 5 seconds and not immediately, then this is the parameter to use.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Video Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. For available options, see the FFmpeg documentation. If a preset is used, the options specified are merged on top of the ones from the preset.

Examples featuring the /video/merge Robot

3.5 Add subtitles to videos

The /video/subtitle Robot adds subtitles to videos.

This robot supports both SRT and VTT subtitle files.

Imagine you have two file input fields in the same upload form - one for a video file and one for an SRT or VTT subtitle file. They are named "input_video" and "input_srt" (with the HTML "name" attribute). This is how you would go about adding the SRT subtitles into the video with Transloadit:

"add_subtitles": {
  "robot": "/video/subtitle",
  "preset": "ipad-high",
  "use": {
    "steps": [
      { "name": ":original", "fields": "input_video", "as": "video" },
      { "name": ":original", "fields": "input_srt", "as": "subtitles" }
    ]
  }
}

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "empty" Performs conversion using pre-configured settings. By default, no settings are applied and the original settings of the video are preserved. For a list of video presets, see video presets.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v3.3.3" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Video Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg documentation. Options specified here take precedence over the preset options.

Examples featuring the /video/subtitle Robot

3.6 Extract thumbnails from videos

The /video/thumbs Robot extracts any number of images from videos for use as previews.

Note Even though thumbnails are extracted from videos in parallel, we sort the thumbnails before adding them to the Assembly results. So the order in which they appear there reflects the order in which they appear in the video. You can also make sure by checking the thumb_index meta key.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
count Integer(1-999) 8 The number of thumbnails to be extracted. As some videos have incorrect durations, the actual number of thumbnails generated may be less in rare cases. The maximum number of thumbails we currently allow is 999.
offsets Array of Integers / Array of Strings [] An array of offsets representing seconds of the file duration, such as [ 2, 45, 120 ]. Offsets can also be percentage values such as [ "2%", "50%", "75%" ]. This option cannot be used with the count parameter, and takes precedence if both are specified. Out-of-range offsets are silently ignored.
format String "jpeg" The format of the extracted thumbnail. Supported values are "jpg", "jpeg" and "png". Even if you specify the format to be "jpeg" the resulting thumbnails will have a "jpg" file extension.
width Integer(1-1920) Width of the video The width of the thumbnail, in pixels.
height Integer(1-1080) Height of the video The height of the thumbnail, in pixels.
resize_strategy String "pad" One of the available resize strategies.
background String "00000000" The background color of the resulting thumbnails in the "rrggbbaa" format (red, green, blue, alpha) when used with the "pad" resize strategy. The default color is black.
rotate Integer Auto Forces the video to be rotated by the specified degree integer. Currently, only multiples of 90 are supported. We automatically correct the orientation of many videos when the orientation is provided by the camera. This option is only useful for videos requiring rotation because it was not detected by the camera.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Video Encoding Presets.

Examples featuring the /video/thumbs Robot

3.7 Video Encoding Presets

These are supported if you were to specify ffmpeg_stack: "v1.0.0" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
android-high mp4 libfaac 128k 48k libx264 700k 480x320
android-low mp4 libfaac 64k 48k libx264 96k 480x320
android mp4 libfaac 128k 48k libx264 512k 480x320
flash flv libmp3lame 64k 44100 flv 512k 320x240
ipad-high mp4 libfaac 128k 48k libx264 1200k 1024x768
ipad-low mp4 libfaac 128k 48k libx264 512k 1024x768
ipad mp4 libfaac 128k 48k libx264 700k 1024x768
iphone-high mp4 libfaac 128k 48k libx264 700k 480x320
iphone-low mp4 libfaac 64k 48k libx264 96k 480x320
iphone mp4 libfaac 128k 48k libx264 512k 480x320
ogv ogg libvorbis 128k 48k libtheora 700k cross
webm webm libvorbis 128k 48k libvpx 700k cross
wmv asf wmav2 cross cross wmv2 cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

These are supported if you were to specify ffmpeg_stack: "v2.0.0" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
android-high mp4 libvo_aacenc 128k 48k libx264 700k 480x320
android-low mp4 libvo_aacenc 64k 48k libx264 96k 480x320
android mp4 libvo_aacenc 128k 48k libx264 512k 480x320
flash flv libmp3lame 64k 44100 flv 512k 320x240
ipad-high mp4 libvo_aacenc 128k 48k libx264 1200k 1024x768
ipad-low mp4 libvo_aacenc 128k 48k libx264 512k 1024x768
ipad mp4 libvo_aacenc 128k 48k libx264 700k 1024x768
iphone-high mp4 libvo_aacenc 128k 48k libx264 700k 480x320
iphone-low mp4 libvo_aacenc 64k 48k libx264 96k 480x320
iphone mp4 libvo_aacenc 128k 48k libx264 512k 480x320
ogv ogg libvorbis 128k 48k libtheora 700k cross
webm webm libvorbis 128k 48k libvpx 700k cross
wmv asf wmav2 cross cross wmv2 cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

These are supported if you were to specify ffmpeg_stack: "v2.1.0" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
android-high mp4 libfdk_aac 128000 44100 libx264 700k 480x320
android-low mp4 libfdk_aac 128000 44100 libx264 96k 480x320
android mp4 libfdk_aac 128000 44100 libx264 512k 480x320
flash flv libmp3lame 64k 44100 flv 512k 320x240
ipad-high mp4 libfdk_aac 128000 44100 libx264 1200k 1024x768
ipad-low mp4 libfdk_aac 128000 44100 libx264 512k 1024x768
ipad mp4 libfdk_aac 128000 44100 libx264 700k 1024x768
iphone-high mp4 libfdk_aac 128000 44100 libx264 700k 480x320
iphone-low mp4 libfdk_aac 128000 44100 libx264 96k 480x320
iphone mp4 libfdk_aac 128000 44100 libx264 512k 480x320
ogv ogg libvorbis 128k 48k libtheora 700k cross
webm webm libvorbis 128k 48k libvpx 700k cross
wmv asf wmav2 cross cross wmv2 cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

These are supported if you were to specify ffmpeg_stack: "v2.2.3" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
android-high mp4 libfdk_aac 128000 44100 libx264 700000 480x320
android-low mp4 libfdk_aac 128000 44100 libx264 96000 480x320
android mp4 libfdk_aac 128000 44100 libx264 512000 480x320
dash-1080p-video mp4 cross cross cross libx264 7500000 1920x1080
dash-270p-video mp4 cross cross cross libx264 460000 480x270
dash-360p-video mp4 cross cross cross libx264 800000 640x360
dash-480p-video mp4 cross cross cross libx264 1300000 854x480
dash-540p-video mp4 cross cross cross libx264 1850000 960x540
dash-576p-video mp4 cross cross cross libx264 2100000 1024x576
dash-720p-video mp4 cross cross cross libx264 3300000 1280x720
flash flv libmp3lame 64000 44100 flv 512000 320x240
hls-1080p mp4 libfdk_aac 256000 44100 libx264 7500000 1920x1080
hls-270p mp4 libfdk_aac 32000 44100 libx264 550000 480x270
hls-360p mp4 libfdk_aac 64000 44100 libx264 1000000 640x260
hls-480p mp4 libfdk_aac 64000 44100 libx264 1300000 854x480
hls-540p mp4 libfdk_aac 128000 44100 libx264 1600000 960x540
hls-576p mp4 libfdk_aac 128000 44100 libx264 2100000 1024x576
hls-720p mp4 libfdk_aac 192000 44100 libx264 4000000 1280x720
ipad-high mp4 libfdk_aac 128000 44100 libx264 1200000 1024x768
ipad-low mp4 libfdk_aac 128000 44100 libx264 512000 1024x768
ipad mp4 libfdk_aac 128000 44100 libx264 700000 1024x768
iphone-high mp4 libfdk_aac 128000 44100 libx264 700000 480x320
iphone-low mp4 libfdk_aac 128000 44100 libx264 96000 480x320
iphone mp4 libfdk_aac 128000 44100 libx264 512000 480x320
ogv ogg libvorbis 128000 48000 libtheora 700000 cross
webm-1080p webm libvorbis 256000 48000 libvpx 7500000 1920x1080
webm-270p webm libvorbis 64000 48000 libvpx 460000 480x270
webm-360p webm libvorbis 64000 48000 libvpx 800000 640x360
webm-480p webm libvorbis 64000 48000 libvpx 1400000 960x540
webm-540p webm libvorbis 128000 48000 libvpx 1850000 960x540
webm-576p webm libvorbis 128000 48000 libvpx 2100000 1024x576
webm-720p webm libvorbis 192000 48000 libvpx 3300000 1280x720
webm webm libvorbis 128000 48000 libvpx 700000 cross
wmv asf wmav2 cross cross wmv2 cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

The hls- and dash- presets are intended for use in combination with our /video/adaptive Robot.

These are supported if you were to specify ffmpeg_stack: "v3.3.3" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
android-high mp4 libfdk_aac 128000 44100 libx264 700000 480x320
android-low mp4 libfdk_aac 128000 44100 libx264 96000 480x320
android mp4 libfdk_aac 128000 44100 libx264 512000 480x320
dash-1080p-video mp4 cross cross cross libx264 7500000 1920x1080
dash-270p-video mp4 cross cross cross libx264 460000 480x270
dash-360p-video mp4 cross cross cross libx264 800000 640x360
dash-480p-video mp4 cross cross cross libx264 1300000 854x480
dash-540p-video mp4 cross cross cross libx264 1850000 960x540
dash-576p-video mp4 cross cross cross libx264 2100000 1024x576
dash-720p-video mp4 cross cross cross libx264 3300000 1280x720
flash flv libmp3lame 64000 44100 flv 512000 320x240
hevc mp4 libfdk_aac 128k 44100 libx265 1200000 cross
hls-1080p mp4 libfdk_aac 256000 44100 libx264 7500000 1920x1080
hls-270p mp4 libfdk_aac 32000 44100 libx264 550000 480x270
hls-360p mp4 libfdk_aac 64000 44100 libx264 1000000 640x260
hls-480p mp4 libfdk_aac 64000 44100 libx264 1300000 854x480
hls-540p mp4 libfdk_aac 128000 44100 libx264 1600000 960x540
hls-576p mp4 libfdk_aac 128000 44100 libx264 2100000 1024x576
hls-720p mp4 libfdk_aac 192000 44100 libx264 4000000 1280x720
ipad-high mp4 libfdk_aac 128000 44100 libx264 1200000 1024x768
ipad-low mp4 libfdk_aac 128000 44100 libx264 512000 1024x768
ipad mp4 libfdk_aac 128000 44100 libx264 700000 1024x768
iphone-high mp4 libfdk_aac 128000 44100 libx264 700000 480x320
iphone-low mp4 libfdk_aac 128000 44100 libx264 96000 480x320
iphone mp4 libfdk_aac 128000 44100 libx264 512000 480x320
ogv ogg libvorbis 128000 48000 libtheora 700000 cross
webm-1080p webm libvorbis 256000 48000 libvpx 7500000 1920x1080
webm-270p webm libvorbis 64000 48000 libvpx 460000 480x270
webm-360p webm libvorbis 64000 48000 libvpx 800000 640x360
webm-480p webm libvorbis 64000 48000 libvpx 1400000 960x540
webm-540p webm libvorbis 128000 48000 libvpx 1850000 960x540
webm-576p webm libvorbis 128000 48000 libvpx 2100000 1024x576
webm-720p webm libvorbis 192000 48000 libvpx 3300000 1280x720
webm webm libvorbis 128000 48000 libvpx 700000 cross
wmv asf wmav2 cross cross wmv2 cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

The hls- and dash- presets are intended for use in combination with our /video/adaptive Robot.

4 Audio Encoding

4.1 Extract or insert audio artwork

The /audio/artwork Robot extracts the embedded cover artwork from audio files and allows you to pipe it into other Steps, for example into /image/resize Steps. It can also insert images into audio files as cover artwork.

For extraction this Robot uses the image format with which the cover was encoded into the audio file - most of the time this should be jpg.

If you need the image in a different format, please pipe the result of this Robot into the /image/resize Robot.

The method parameter determines wether to extract or insert.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
method String "extract" What should be done with the audio file. A value of "extract" means audio artwork will be extract. A value of "insert" means the provided image will be inserted as audio artwork.

Examples featuring the /audio/artwork Robot

4.2 Concatenate audio

The /audio/concat Robot concatenates several audio files together.

It is possible to concatenate a virtually infinite number of audio files using the /audio/concat Robot.

Imagine you have three file input fields in the same upload form for audio files that you want to concatenate. You can tell Transloadit in which order it should concatenate them using the file input field's name attribute. Just use the value for the name attribute as the value for the fields key in the JSON. Then set the proper order in the as parameter. Valid values here are audio_[[index]]. Transloadit will then concatenate them in the order of the index ascending:

"concatenated": {
  "robot": "/audio/concat",
  "preset": "mp3",
  "use": {
    "steps": [
      { "name": ":original", "fields": "first_audio_file", "as": "audio_1" },
      { "name": ":original", "fields": "second_audio_file", "as": "audio_2" },
      { "name": ":original", "fields": "third_audio_file", "as": "audio_3" }
    ]
  }
}

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "mp3" Performs conversion using pre-configured settings. If you specify your own FFmpeg parameters using the Robot's ffmpeg parameter and you have not specified a preset, then the default mp3 preset is not applied. This is to prevent you from having to override each of the MP3 preset's values manually. For a list of audio presets, see audio presets.
bitrate Integer Auto Bit rate of the resulting audio file, in bits per second. If not specified will default to the bit rate of the input audio file
sample_rate Integer Auto Sample rate of the resulting audio file, in Hertz. If not specified will default to the sample rate of the input audio file

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Audio Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg documentation. Options specified here take precedence over the preset options.

Examples featuring the /audio/concat Robot

4.3 Encode audio

The /audio/encode Robot converts audio files into all kinds of formats for you. We provide encoding presets for the most common formats.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "mp3" Performs conversion using pre-configured settings. If you specify your own FFmpeg parameters using the Robot's ffmpeg parameter and you have not specified a preset, then the default mp3 preset is not applied. This is to prevent you from having to override each of the mp3 preset's values manually. For a list of audio presets, see audio presets.
bitrate Integer Auto Bit rate of the resulting audio file, in bits per second. If not specified will default to the bit rate of the input audio file
sample_rate Integer Auto Sample rate of the resulting audio file, in Hertz. If not specified will default to the sample rate of the input audio file

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Audio Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg documentation. Options specified here take precedence over the preset options.

HLS Parameters

This Robot used to support HLS parameters but we now recommend using our specialized /video/adaptive Robot instead.

Examples featuring the /audio/encode Robot

4.4 Loop audio

The /audio/loop Robot loops one audio file as often as is required to match a given duration.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "mp3" Performs conversion using pre-configured settings. If you specify your own FFmpeg parameters using the Robot's ffmpeg parameter and you have not specified a preset, then the default mp3 preset is not applied. This is to prevent you from having to override each of the mp3 preset's values manually. For a list of audio presets, see audio presets.
bitrate Integer Auto Bit rate of the resulting audio file, in bits per second. If not specified will default to the bit rate of the input audio file
sample_rate Integer Auto Sample rate of the resulting audio file, in Hertz. If not specified will default to the sample rate of the input audio file
duration Float 60.0 Target duration for the whole process in seconds. The Robot will loop the input audio file for as long as this target duration is not reached yet.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Audio Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg documentation. Options specified here take precedence over the preset options.

Examples featuring the /audio/loop Robot

4.5 Merge audio files into one

The /audio/merge Robot overlays several audio files on top of each other.

It is possible to merge a virtually infinite number of audio files using the /audio/merge Robot.

Imagine you have three file input fields in the same upload form for audio files that you want to merge. You can tell Transloadit to merge them using the file input field's name attribute. Just use the value for the name attribute as the value for the fields key in the JSON and audio as the as parameter:

"my_merge_step": {
  "robot": "/audio/merge",
  "preset": "mp3",
  "use": {
    "steps": [
      { "name": ":original", "fields": "first_audio_file", "as": "audio" },
      { "name": ":original", "fields": "second_audio_file", "as": "audio" },
      { "name": ":original", "fields": "third_audio_file", "as": "audio" }
    ]
  }
}

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
preset String "mp3" Performs conversion using pre-configured settings. If you specify your own FFmpeg parameters using the Robot's ffmpeg parameter and you have not specified a preset, then the default "mp3" preset is not applied. This is to prevent you from having to override each of the mp3 preset's values manually. For a list of audio presets, see audio presets.
bitrate Integer Auto Bit rate of the resulting audio file, in bits per second. If not specified will default to the bit rate of the input audio file
sample_rate Integer Auto Sample rate of the resulting audio file, in Hertz. If not specified will default to the sample rate of the input audio file
duration String "longest" Duration of the output file compared to the duration of all merged audio files. Can be "first" (duration of the first input file), "shortest" (duration of the shortest audio file) or "longest" for the duration of the longest input file.
loop boolean false Specifies if any input files that do not match the target duration should be looped to match it. Useful for audio merging where your overlay file is typically much shorter than the main audio file.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Audio Encoding Presets.
ffmpeg Object {} A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg documentation. Options specified here take precedence over the preset options.

Examples featuring the /audio/merge Robot

4.6 Generate waveform images from audio

The /audio/waveform Robot generates waveform images for your audio files and allows you to change their colors and dimensions.

We recommend that you use an /audio/encode Step prior to your waveform Step to convert audio files to MP3. This way it is guaranteed that the /audio/waveform Robot accepts your audio file and you can also down-sample large audio files and save some money.

Similarly, if you need the output image in a different format, please pipe the result of this Robot into the /image/resize Robot.

Here is an example waveform image:

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
format String "image" The format of the result file. Can be "image" or "json".
width Integer 256 The width of the resulting image if the format "image" was selcted.
height Integer 64 The height of the resulting image if the format "image" was selcted.
background_color String "00000000" The background color of the resulting image in the "rrggbbaa" format (red, green, blue, alpha), if the format "image" was selected.
center_color String "000000ff" The color used in the center of the gradient. The format is "rrggbbaa" (red, green, blue, alpha).
outer_color String "000000ff" The color used in the outer parts of the gradient. The format is "rrggbbaa" (red, green, blue, alpha).

Examples featuring the /audio/waveform Robot

4.7 Audio Encoding Presets

These are supported if you were to specify ffmpeg_stack: "v1.0.0" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
aac mp4 libfaac 128000 44100 cross cross cross
alac ipod alac 128000 44100 cross cross cross
flac flac flac 128000 44100 cross cross cross
mp3 mp3 libmp3lame 128000 44100 cross cross cross
ogg ogg libvorbis cross cross cross cross cross
wav wav pcm_s16le cross cross cross cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

These are supported if you were to specify ffmpeg_stack: "v2.0.0" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
aac mp4 libvo_aacenc 128000 44100 cross cross cross
alac ipod alac 128000 44100 cross cross cross
flac flac flac 128000 44100 cross cross cross
mp3 mp3 libmp3lame 128000 44100 cross cross cross
ogg ogg libvorbis cross cross cross cross cross
wav wav pcm_s16le cross cross cross cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

These are supported if you were to specify ffmpeg_stack: "v2.1.0" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
aac mp4 libfdk_aac 128000 44100 cross cross cross
alac ipod alac 128000 44100 cross cross cross
flac flac flac 128000 44100 cross cross cross
mp3 mp3 libmp3lame 128000 44100 cross cross cross
ogg ogg libvorbis cross cross cross cross cross
wav wav pcm_s16le cross cross cross cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

These are supported if you were to specify ffmpeg_stack: "v2.2.3" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
aac mp4 libfdk_aac 128000 44100 cross cross cross
alac ipod alac 128000 44100 cross cross cross
dash-128k-audio mp4 cross 128000 44100 cross cross cross
dash-256k-audio mp4 cross 256000 44100 cross cross cross
dash-32k-audio mp4 cross 32000 44100 cross cross cross
dash-64k-audio mp4 cross 64000 44100 cross cross cross
flac flac cross 128000 44100 cross cross cross
mp3 mp3 libmp3lame 128000 44100 cross cross cross
ogg ogg libvorbis cross cross cross cross cross
wav wav pcm_s16le cross cross cross cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

The hls- and dash- presets are intended for use in combination with our /video/adaptive Robot.

These are supported if you were to specify ffmpeg_stack: "v3.3.3" in your Assembly Instructions. The recommended version is: v2.2.3

Name Format Audio codec Audio bitrate Audio frequency Video codec Video bitrate Video resolution
aac mp4 libfdk_aac 128000 44100 cross cross cross
alac ipod alac 128000 44100 cross cross cross
dash-128k-audio mp4 cross 128000 44100 cross cross cross
dash-256k-audio mp4 cross 256000 44100 cross cross cross
dash-32k-audio mp4 cross 32000 44100 cross cross cross
dash-64k-audio mp4 cross 64000 44100 cross cross cross
empty cross cross cross cross cross cross cross
flac flac cross 128000 44100 cross cross cross
mp3 mp3 libmp3lame 128000 44100 cross cross cross
ogg ogg libvorbis cross cross cross cross cross
opus ogg libopus 128000 48000 cross cross cross
wav wav pcm_s16le cross cross cross cross cross

You can override any preset's setting, such as a file's bitrate, or even the file's format & codecs via a Robot's ffmpeg parameter.

The hls- and dash- presets are intended for use in combination with our /video/adaptive Robot.

5 Image Manipulation

5.1 Optimize images without quality loss

The /image/optimize Robot reduces the size of images while maintaining the same visual quality.

With this Robot it's possible to reduce the file size of your JPEG, PNG, GIF and SVG images by up to 80% for big images and 65% for small to medium sized ones - while keeping their original quality!

This Robot enables you to lower your storage and bandwidth costs, and improves your user experience and monetization by reducing the load time of image-intensive web pages.

It works well together with the /image/resize Robot to bring the full power of resized and optimized images to your website or app.

Important This Robot accepts all image types and will just pass on unsupported image types unoptimized. Hence, there is no need to set up /file/filter Robot workflows for this.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
priority string compression-ratio Provides different algorithms for better or worse compression for your images, but that run slower or faster. Valid values are "compression-ratio" and "conversion-speed". The value "conversion-speed" will result in an average compression ratio of 18%. "compression-ratio" will result in an average compression ratio of 31%.
progressive Boolean false Interlaces the image if set to true, which makes the result image load progressively in browsers. Instead of rendering the image from top to bottom, the browser will first show a low-res blurry version of the image which is then quickly replaced with the actual image as the data arrives. This greatly increases the user experience, but comes at a loss of about 10% of the file size reduction.
preserve_meta_data Boolean true Specifies if the image's meta data should be preserved during the optimization, or not. If it is not preserved, the file size is even further reduced. This option is mandatory if you set png_tool to "pngquant"
fix_breaking_images Boolean true If set to true this parameter tries to fix images that would otherwise make the underlying tool error out and thereby break your Assemblies. This can sometimes result in a larger file size, though.

Examples featuring the /image/optimize Robot

5.2 Convert, resize, or watermark images

The /image/resize Robot resizes, crops, changes colorization, rotation, and applies text and watermarks to images.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
format String Auto Some of the most important available formats are "jpg", "png", "gif", "tiff" and "pdf". For a complete lists of all formats that we can write to please check our supported image formats list. If this parameter is not specified it will default to the format of the input image
width Integer(1-5000) Auto Width of the new image, in pixels. If not specified, will default to the width of the input image
height Integer(1-5000) Auto Height of the new image, in pixels. If not specified, will default to the height of the input image
resize_strategy String "fit" See the list of available resize strategies.
zoom Boolean true If this is set to false, smaller images will not be stretched to the desired width and height. For details about the impact of zooming for your preferred resize strategy, see the list of available resize strategies.
crop Object / JSON String null Specify an object containing coordinates for the top left and bottom right corners of the rectangle to be cropped from the original image(s). For example:
{
  "x1": 80,
  "y1": 100,
  "x2": 160,
  "y2": 180
}
will crop the area from (80, 100) to (160, 180) which is a square whose width and height are 80px. If crop is set, the width and height parameters are ignored, and the resize_strategy is set to crop automatically. You can also use a JSON string of such an object with coordinates in similar fashion: "{ \"x1\": <Integer>, \"y1\": <Integer>, \"x2\": <Integer>, \"y2\": <Integer> }" To crop around human faces, see our /image/facedetect Robot.
gravity String center The direction from which the image is to be cropped, when "resize_strategy" is set to "crop", but no crop coordinates are defined. The available options are "center", "top", "bottom", "left", and "right". You can also combine options with a hyphen, such as "bottom-right".
strip Boolean false Strips all metadata from the image. This is useful to keep thumbnails as small as possible.
alpha string "" Gives control of the alpha/matte channel of an image. Valid options are "Activate", "Background", "Copy", "Deactivate", "Extract", "Off", "On", "Opaque", "Remove", "Set", "Shape", "Transparent"
preclip_alpha string "" Gives control of the alpha/matte channel of an image before applying the clipping path via clip: true. Valid options are "Activate", "Background", "Copy", "Deactivate", "Extract", "Off", "On", "Opaque", "Remove", "Set", "Shape", "Transparent"
flatten Boolean true Flattens all layers onto the specified background to achieve better results from transparent formats to non-transparent formats, as explained in the ImageMagick documentation. To preserve animations, GIF files are not flattened when this is set to true. To flatten GIF animations, use the frame parameter.
correct_gamma Boolean false Prevents gamma errors common in many image scaling algorithms.
quality Integer(1-100) Quality Controls the image compression for JPG and PNG images. Please also take a look at our /image/optimize Robot.
Before:


Quality 92 applied:


Quality 40 applied:


If this parameter is not specified it will default to the quality of the input image, or 92
background String "#FFFFFF" Either the hexadecimal code or name of the color used to fill the background (only used for the pad resize strategy). By default, the background of transparent images is changed to white. For details about how to preserve transparency across all image types, see this demo.
frame Integer / Null null Use this parameter when dealing with animated GIF files to specify which frame of the GIF is used for the operation. Specify 1 to use the first frame, 2 to use the second, and so on. null means all frames.
colorspace String "" Sets the image colorspace. For details about the available values, see the ImageMagick documentation. Please note that if you were using "RGB", we recommend using "sRGB" instead as of 2014-02-04. ImageMagick might try to find the most efficient colorspace based on the color of an image, and default to e.g. "Gray". To force colors, you might then have to use this parameter in combination with type "TrueColor"
type String "" Sets the image color type. For details about the available values, see the ImageMagick documentation. If you're using colorspace, ImageMagick might try to find the most efficient based on the color of an image, and default to e.g. "Gray". To force colors, you could e.g. set this parameter to "TrueColor"
sepia Integer(0-99) / Null null Sets the sepia tone in percent.
Before:


After setting sepia to 90:


After setting sepia to 40:


After setting sepia to 10:
rotation String / Boolean / Integer true Determines whether the image should be rotated. Set this to true to auto-rotate images that are rotated in a wrong way, or depend on EXIF rotation settings. You can also set this to an integer to specify the rotation in degrees. You can also specify "degrees" to rotate only when the image width exceeds the height (or "degrees" if the width must be less than the height). Specify false to disable auto-fixing of images that are rotated in a wrong way.
compress String / Null null Specifies pixel compression for when the image is written. Valid values are "None", "BZip", "Fax", "Group4", "JPEG", "JPEG2000", "Lossless", "LZW", "RLE", and "Zip". Compression is disabled by default. Please also take a look at our /image/optimize Robot.
blur String / Null null Specifies gaussian blur, using a value with the form {radius}x{sigma}. The radius value specifies the size of area the operator should look at when spreading pixels, and should typically be either "0" or at least two times the sigma value. The sigma value is an approximation of how many pixels the image is "spread"; think of it as the size of the brush used to blur the image. This number is a floating point value, enabling small values like "0.5" to be used.
progressive Boolean false Interlaces the image if set to true, which makes the image load progressively in browsers. Instead of rendering the image from top to bottom, the browser will first show a low-res blurry version of the images which is then quickly replaced with the actual image as the data arrives. This greatly increases the user experience, but comes at a cost of a file size increase by around 10%.
transparent String "" Make this color transparent within the image.
trim_whitespace Boolean false This determines if additional whitespace around the image should first be trimmed away. If you set this to true this parameter removes any edges that are exactly the same color as the corner pixels.
clip Boolean / String false Apply the clipping path to other operations in the resize job, if one is present. If set to true, it will automatically take the first clipping path. If set to a String it finds a clipping path by that name.
negate Boolean false Replace each pixel with its complementary color, effectively negating the image. Especially useful when testing clipping.
density String null While in-memory quality and file format depth specifies the color resolution, the density of an image is the spatial (space) resolution of the image. That is the density (in pixels per inch) of an image and defines how far apart (or how big) the individual pixels are. It defines the size of the image in real world terms when displayed on devices or printed. You can set this value to a specific width or in the format widthxheight. If your converted image has a low resolution, please try using the density parameter to resolve that.
output_meta Object {} Allows you to specify a set of meta data that is more expensive on cpu power to calculate, and thus is disabled by default to keep your Assemblies processing fast. You can add "has_transparency": true in this object to extract if the image contains transparent parts.

Text Overlay Parameters

Name Type Default Description
text Array of Objects [] An array of objects each containing text rules. The following text parameters are intended to be used as properties for your array of text overlays. Here is an example:
"watermarked": {
  "use": "resized",
  "robot": "/image/resize",
  "imagemagick_stack": "v1.0.0",
  "text": [
    {
      "text": "© 2018 Transloadit.com",
      "size": 12,
      "font": "Ubuntu",
      "color": "#eeeeee",
      "valign": "bottom",
      "align": "right",
      "x_offset": 16,
      "y_offset": -10
    }
  ]
}

Before:


After:
font String "Arial" The font family to use. Also includes boldness and style of the font. Here is a list of all supported fonts.
size Integer 12 The text size in pixels.
rotate Integer 0 The rotation angle in degrees.
color String "#000000" The text color. All hex colors in the form "#xxxxxx" are supported, where each x can be 0-9 or a-f. "transparent" is also supported if you want a transparent text color. In that case use "stroke" instead, otherwise your text will not be visible.
background_color String "transparent" The text color. All hex colors in the form "#xxxxxx" are supported, where each x is can be 0-9 or a-f. "transparent" is also supported.
stroke_width Integer 0 The stroke's width in pixels.
stroke_color String "transparent" The stroke's color. All hex colors in the form "#xxxxxx" are supported, where each x is can be 0-9 or a-f. "transparent" is also supported.
align String "center" The horizontal text alignment. Can be "left", "center" and "right".
valign String "center" The vertical text alignment. Can be "top", "center" and "bottom".
x_offset Integer 0 The horizontal offset for the text in pixels that is added (positive integer) or removed (negative integer) from the horizontal alignment.
y_offset Integer 0 The vertical offset for the text in pixels that is added (positive integer) or removed (negative integer) from the vertical alignment.

Watermarking Parameters

Name Type Default Description
watermark_url String "" A URL indicating a PNG image to be overlaid above this image. Please note that you can also supply the watermark via another Assembly Step. With watermarking you can add an image onto another image. This is usually used for logos.

Before:


After:
watermark_position String / Array of Strings "center" The position at which the watermark is placed. The available options are "center", "top", "bottom", "left", and "right". You can also combine options, such as "bottom-right". An array of possible values can also be specified, in which case one value will be selected at random, such as [ "center", "left", "bottom-left", "bottom-right" ]. This setting puts the watermark in the specified corner. To use a specific pixel offset for the watermark, you will need to add the padding to the image itself.
watermark_x_offset Integer 0 The x-offset in number of pixels at which the watermark will be placed in relation to the position it has due to watermark_position. Values can be both positive and negative and yield different results depending on the watermark_position parameter. Positive values move the watermark closer to the image's center point, whereas negative values move the watermark further away from the image's center point.
watermark_y_offset Integer 0 The y-offset in number of pixels at which the watermark will be placed in relation to the position it has due to watermark_position. Values can be both positive and negative and yield different results depending on the watermark_position parameter. Positive values move the watermark closer to the image's center point, whereas negative values move the watermark further away from the image's center point.
watermark_size String "" The size of the watermark, as a percentage. For example, a value of "50%" means that size of the watermark will be 50% of the size of image on which it is placed. The exact sizing depends on watermark_resize_strategy, too.
watermark_resize_strategy String "fit" Available values are "fit", "stretch" and "area". To explain how the resize strategies work, let's assume our target image size is 800×800 pixels and our watermark image is 400×300 pixels. Let's also assume, the watermark_size parameter is set to "25%". For the "fit" resize strategy, the watermark is scaled so that the longer side of the watermark takes up 25% of the corresponding image side. And the other side is scaled according to the aspect ratio of the watermark image. So with our watermark, the width is the longer side, and 25% of the image size would be 200px. Hence, the watermark would be resized to 200×150 pixels. If the watermark_size was set to "50%"", it would be resized to 400×300 pixels (so just left at its original size). For the "stretch" resize strategy, the watermark is stretched (meaning, it is resized without keeping its aspect ratio in mind) so that both sides take up 25% of the corresponding image side. Since our image is 800×800 pixels, for a watermark size of 25% the watermark would be resized to 200×200 pixels. Its height would appear stretched, because keeping the aspect ratio in mind it would be resized to 200×150 pixels instead. For the "area" resize strategy, the watermark is resized (keeping its aspect ratio in check) so that it covers "xx%" of the video's surface area. The value from watermark_size is used for the percentage area size.

ImageMagick Parameters

Name Type Default Description
imagemagick_stack String "v1.0.0" Selects the ImageMagick stack for the processing. Valid values are at the moment: "v1.0.0" and "v2.0.3". These versions do not reflect any real ImageMagick versions, they reflect our own internal (non-semantic) versioning for our custom FFmpeg builds.

Supplying the Watermark via an Assembly Step

It is now possible to pass both the base image file and the watermark image to an Assembly Step via the use parameter, allowing you to either have both be part of the upload or to use results of other Assembly Steps as input to your /image/resize Step.

For this to work you just need to use the as-syntax:

"my_image_step": {
  "robot": "/image/resize",
  "use": {
    "steps": [
      { "name": ":original", "as": "base" },
      { "name": "watermark_step", "as": "watermark" }
    ]
  }
}

Here the output of a watermark_step step is used as the watermark whereas the base image is taken from the uploaded files.

If you use several file input fields, then you can tell Transloadit which field supplies the base image and which the watermark. Suppose you have two file input fields named the_image and the_watermark. These Assembly Instructions will make it work using the fields condition:

"my_image_step": {
  "robot": "/image/resize",
  "use": {
    "steps": [
      { "name": ":original", "fields": "the_image", "as": "base" },
      { "name": ":original", "fields": "the_watermark", "as": "watermark" }
    ]
  }
}

Please note that the Robot's watermark_url parameter will still continue to work.

Resize Strategies

The examples below show how the resize_strategy impacts resizing a 400×300 pixel image to 100×100 pixels:

fit

Uses the larger side of the original image as a base for the resize. Aspect ratio is preserved. Either side will become at most 100 pixels.

For example: resizing a 400×300 image into 100×100, would produce a 100×75 image.

Before
Larger side
19 KB ⋅ 400×300
After
100 px
4.6 KB ⋅ 100×75

fillcrop

Scales the image to fit into our 100×100 target while preserving aspect ratio, while trimming away any excess surface. This means both sides will become exactly 100 pixels, at the tradeoff of destroying parts of the image.

By default the resulting image is horizontally/vertically centered to fill the target rectangle. Use the gravity parameter to change where to crop the image, such as "bottom" or "left".

Before
19 KB ⋅ 400×300
After
5 KB ⋅ 100×100

min_fit

Uses the smaller side of the original image as a base for the resize. After resizing, the larger side will have a larger value than specified. Aspect ratio is preserved. Either side will become at least 100 pixels.

For example: resizing a 400×300 image into 100×100, would produce a 133×100 image.

Before
Smaller side
19 KB ⋅ 400×300
After
100 px
5.4 KB ⋅ 133×100

pad

Scales the image to fit while preserving aspect ratio. Both sides of the resized image become exactly 100 pixels, and any remaining surface is filled with a background color.

In this example, the background color is determined by the Assembly Variable ${file.meta.average_color}. If you set zoom to false (default is true), smaller images will be centered horizontally and vertically, and have the background padding all around them.

Before
19 KB ⋅ 400×300
After
4.7 KB ⋅ 100×100

stretch

Ignores aspect ratio, resizing the image to the exact width and height specified. This may result in a stretched or distorted image.

Before
19 KB ⋅ 400×300
After
5 KB ⋅ 100×100

crop

Cuts an area out of an image, discarding any overlapping parts. If the source image is smaller than the crop frame, it will be zoomed. This strategy is implied when you specify coordinates in the crop parameter, and cannot be used without it.

To crop around human faces, see our /image/facedetect Robot instead.

Before
19 KB ⋅ 400×300
After
4.3 KB ⋅ 100×100

Examples featuring the /image/resize Robot

6 Computer Vision

6.1 Detect faces in images

The /image/facedetect Robot detects faces in images and returns their coordinates, or cuts them from the original images and returns those as new images.

As mentioned this Robot enables you to detect and extract human faces from your images. You can also specify a padding around the extracted faces.

It works well together with the /image/resize Robot to bring the full power of resized and optimized images to your website or app.

Important This Robot accepts all image types. By giving the format parameter the value "preserve" the result face images will have the same image format (JPG, PNG, etc.).

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
crop Boolean false Determine if the detected faces should be extracted. If this option is set to false, then the Robot returns the input image again, but with the coordinates of all detected faces attached to file.meta.faces in the result JSON. If this parameter is set to true, the Robot will output all detected faces as images.
crop_padding String "5px" Specifies how much padding is added to the extracted face images if crop is set to true. Values can be in px (pixels) or % (percentage of the width and height of the particular face image).
format String "preserve" Determines the output format of the extracted face images if crop is set to true. The default value "preserve" means that the input image format is re-used. Valid values are "jpg", "png", "tiff" and "preserve".

Examples featuring the /image/facedetect Robot

7 Document Processing

7.1 Convert documents into different formats

The /document/convert Robot converts documents into different formats.

Note This Robot currently only supports the conversion of SRT files to VTT (video subtitle formats). We will add support for other document formats later.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
format String "" The desired format for the document. The only supported value right now is "vtt".

Examples featuring the /document/convert Robot

7.2 Extract thumbnail images from documents

The /document/thumbs Robot generates an image for each page in a PDF file or an animated gif file that loops through all pages.

Note This Robot currently only supports the conversion of PDF files. We will add support for other document formats later.

Things to Keep in Mind

  • If you convert a multi-page PDF file into several images, all result images will be sorted with the first image being the thumbnail of the first document page, etc.
  • You can also check the meta.thumb_index key of each result image to find out which page it corresponds to. Keep in mind that these thumb indices start at 0 and not at 1!

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
page Integer / Null null The PDF's page that you want to convert to an image. By default the value is null which means that all pages will be converted into images.
format String "png" The format of the extracted image(s). Supported values are "jpeg", "jpg", "gif" and "png". If you specify the value "gif" then an animated gif cycling through all pages is created. Please check out this demo to learn more about this.
delay Integer / Null null If your output format is "gif" then this parameter sets the number of 100th seconds to pass before the next frame is shown in the animation. Set this to 100 for example to allow 1 second to pass between the frames of the animated gif. If your output format is not "gif", then this parameter does not have any effect.
width Integer(1-5000) Auto Width of the new image, in pixels. If not specified, will default to the width of the input image
height Integer(1-5000) Auto Height of the new image, in pixels. If not specified, will default to the height of the input image
resize_strategy String "pad" One of the available resize strategies.
background String "#FFFFFF" Either the hexadecimal code or name of the color used to fill the background (only used for the pad resize strategy). Note by default, the background of transparent images is changed to white. For details about how to preserve transparency across all image types, see this demo.
density String / Null null While in-memory quality and file format depth specifies the color resolution, the density of an image is the spatial (space) resolution of the image. That is the density (in pixels per inch) of an image and defines how far apart (or how big) the individual pixels are. It defines the size of the image in real world terms when displayed on devices or printed. You can set this value to a specific width or in the format widthxheight. If your converted image has a low resolution, please try using the density parameter to resolve that.
trim_whitespace Boolean true This determines if additional whitespace around the PDF should first be trimmed away before it is converted to an image. If you set this to true only the real PDF page contents will be shown in the image. If you need to reflect the PDF's dimensions in your image, it is generally a good idea to set this to false.
pdf_use_cropbox Boolean true Some PDF documents lie about their dimensions. For instance they'll say they are landscape, but when opened in decent Desktop readers, it's really in portrait mode. This can happen if the document has a cropbox defined. When this option is enabled (by default), the cropbox is leading in determining the dimensions of the resulting thumbnails.

Examples featuring the /document/thumbs Robot

7.3 Take screenshots of webpages

The /html/convert Robot takes screenshots of web pages or uploaded HTML pages.

A URL can be provided instead of an input HTML file, to capture a screenshot from the website referenced by the URL.

Use the /image/resize Robot to resize or crop the screenshot as needed.

Note A validation error will occur if neither an HTML file is uploaded nor a URL parameter is given.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
url String / Null null The URL of the web page to be converted. Optional, as you can also upload/import HTML files and pass it to this Robot
format String "png" The format of the resulting image. The supported values are "jpg","jpeg", "png" and "pdf".
fullpage boolean true Determines if a screenshot of the full page should be taken or not. If set to true, the height parameter will not have any effect, as heights of websites vary. You can control the size of the resulting image somewhat, though, by setting the width parameter. If set to false, an image will be cropped from the top of the webpage according to your width and height parameters.
width Integer 1024 The screen width that will be used, in pixels. Change this to change the dimensions of the resulting image.
height Integer 768 The screen height that will be used, in pixels. By default this equals the length of the web page in pixels if fullpage is set to true. If fullpage is set to false, the height parameter takes effect and defaults to the value 768.
delay Integer 2000 The delay (in milliseconds) applied to allow the page and all of its JavaScript to render before taking the screenshot.

Examples featuring the /html/convert Robot

8 File Filtering

8.1 Filter files

The /file/filter Robot is a gatekeeper that can direct files to different encoding Steps based on your conditions.

Think of this Robot as your if/else checks to construct advanced file conversion workflows and to not convert certain files that your users uploaded depending on their meta data.

The accepts and declines parameters can each be set to an array with three members:

  • A value or job variable, such as ${file.mime}
  • One of the following operators: =, <, >, <=, >=, !=, regex, !regex
  • A value or job variable, such as 50 or "foo"

Examples:

  • ['${file.meta.width}', '>', '${file.meta.height}']
  • ['${file.size}', '<=', '720']
  • ['720', '>=', '${file.size}']
  • ['${file.mime}', 'regex', 'image']

Important If you would like to match against a null value or a value that is not present (like an audio file does not have a video_codec property in its meta data), please match against '' (an empty string) instead. We'll support proper matching against null in the future, but we cannot easily right now without breaking backwards compatibility.

The following lists the supported job variables.

Available Job Variables

Note Conditions on properties that a file does not have will be ignored. For example, an image does not have ${file.meta.bitrate}. Also, note that since ${file.width} will be ignored, use ${file.meta.width} instead.

Variable Description

${account_id}

The ID of your Transloadit account.

${assembly.id}

The ID of the Assembly representing the current upload.

${unique_prefix}

A unique 33-character prefix used to avoid file name collisions, such as "f2/d3eeeb67479f11f8b091b04f6181ad"

${previous_step.name}

The name of the previous Step that produced the file currently uploaded by the /s3/store Robot.

${file.name}

The name of the stored file.

${file.url_name}

The name of the stored file, from which any characters other than A-Za-z0-9-_. are stripped, and with dashes instead of spaces.

${file.*}

Any file property available in the final results array, such as ${file.meta.width}. For details, see the metadata documentation.

Available Operators for the Conditions

Operator Description Example

=

equals

['${file.ext}', '=', 'jpg']

<

less than

['${file.size}', '<', '1024']

>

greater than

['${file.meta.width}', '>', '${file.meta.height}']

<=

less or equal

['${file.meta.audio_bitrate}', '<=', '256000']

>=

greater or equal

['${file.meta.audio_samplerate}', '>=', '44100']

!=

not equal to

['${file.ext}', '!=', 'jpg']

regex

case-insensitive JavaScript RegExp .match()

['${file.mime}', 'regex', 'image']

!regex

case-insensitive JavaScript RegExp !.match()

['${file.mime}', '!regex', 'image']

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
accepts Array of Arrays [] Files that match at least one requirement will be accepted, or declined otherwise. Example:
[['${file.mime}', '=', 'image/gif']].
If the condition_type parameter is set to "and ", then all requirements must match for the file to be accepted.
declines Array of Arrays [] Files that match at least one requirement will be declined, or accepted otherwise. Example:
[['${file.size}','>','1024']].
If the condition_type parameter is set to "and ", then all requirements must match for the file to be declined.
condition_type String "or" Specifies the condition type according to which the members of the accepts or declines arrays should be evaluated. Can be "or" or "and".
error_on_decline Boolean false If this is set to true and one or more files are declined, the Assembly will be stopped and marked with an error.
error_msg String "One of your files was declined" This is the error message shown to your users (such as by the jQuery SDK) when a file is declined and error_on_decline is set to true.

Examples featuring the /file/filter Robot

8.2 Scan files for viruses

The /file/virusscan Robot rejects millions of trojans, viruses, malware & other malicious threats before they reach your platform.

This Robot is built on top of ClamAV, the best open source antivirus engine available. We update its signatures on a daily basis.

By default, this Robot excludes all malicious files from further processing without any additional notification. This behavior can be changed by setting error_on_decline to true, which will stop Assemblies as soon as malicious files are found. Such Assemblies will then be marked with an error.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
error_on_decline Boolean false If this is set to true and one or more files are declined, the Assembly will be stopped and marked with an error.
error_msg String "One of your files was declined" This is the error message shown to your users (such as by the jQuery SDK) when a file is declined and error_on_decline is set to true.

Examples featuring the /file/virusscan Robot

9 Media Cataloging

9.1 Generate media playlists

The /media/playlist Robot merges segment files to generate playlist files for HTTP Live Streaming (HLS).

Important The /media/playlist Robot is deprecated and will soon be removed! Please use our /video/adaptive Robot for all your HLS and MPEG-Dash needs instead.

The /media/playlist Robot is able to generate playlist files for HTTP Live Streaming (HLS).

This Robot accepts HLS segments generated by the /audio/encode and /video/encode Robots. You need to pass an /audio/encode or /video/encode Step that had its segment parameter set to true to the use parameter of this Robot.

The segments need to be passed to the Robot all at the same time, and not one by one. That's why you must use the bundle_steps parameter, otherwise you will generate multiple playlist files each containing only one segment.

Also, please make sure that you export your segments (to Amazon S3 for example). If you do not do that your playlist file will become invalid after 24 hours, as we remove temporary result files after that time.

Here is a complete example on how to implement HTTP Live Streaming (HLS) for video with Transloadit. It also works with the /audio/encode Robot, though.

Generating a Master Playlist - a Playlist of Playlists

You can also pipe the output of several playlist Steps into another playlist Step to build a HLS playlist of playlists. The master playlist will make use of the resolution and bandwidth parameters of the parameter playlists. Here is an example:

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
name String "playlist.m3u8" The final name of the playlist file.
relative_to String "" URL prefixes to use in the playlist file. Example: "/234p/"
resolution String "" The resolution reported in the playlist file. Example: "416×234". More info.
codecs String "" The codecs reported in the playlist file. Example: "avc1.42001e,mp4a.40.34". More info.
bandwidth String("auto") / Integer "auto" The bandwidth reported in the playlist file. Example: 2560000. More info. This value is expressed in bits per second.
meta_name String "" The meta name as used for NAME in the #EXT-X-STREAM-INF path in playlists. Can be different from the (file)name.
protocol String "http" The URL protocol used for all URLs in playlists. Can be "http" or "https".

Examples featuring the /media/playlist Robot

9.2 Write metadata to media

The /meta/write Robot writes meta data into any file that supports it.

This Robot currently accepts images, videos and audio files.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
data_to_write Object {} A key/value map defining the meta data to write into the file.

FFmpeg Parameters

Name Type Default Description
ffmpeg_stack String "v1.0.0" Selects the (non-semantic) FFmpeg stack version to use for encoding. The current recommendation is to use "v2.2.3" Other valid values can be found at Video Encoding Presets.

Examples featuring the /meta/write Robot

10 File Compressing

10.1 Compress files

The /file/compress Robot creates archives of files or file conversion results.

Archive structure for the "advanced" file layout.

There are a few things that we kept in mind when designing the "advanced" archive structure:

  1. There could be naming collisions.
  2. You want to know which Step a result file belongs to.
  3. You want to know from which originally uploaded file a result file was generated.
  4. ideally you want subfolders for a better structure of files.

To achieve all this, we have created the following archive file structure.

  1. There is a subfolder for each Step name that has result files in the archive.
  2. Files are named according to [first_2_letters_of_unique_original_prefix]_[first_2_letters_of_unique_prefix]_[original_file_name]. If you do not know what the original prefixes are, please check our available Assembly variables and look for ${unique_original_prefix} and ${unique_prefix}.
  3. Files that belong to the :original Step (originally uploaded files) do not include the first two letters of the unique_original_prefix.
  4. If you are dealing with thumbnails from the /video/thumbs Robot, there is an additional digit representing the order in the file name.

Here is an example:

":original":
  - gh_a.mov          # "gh" are the first 2 letters of the unique prefix.
                      # "a.mov" was the file name of the uploaded file.
  - ff_b.mov
"thumbed":
  - gh_e8_thumb_1.jpg # "gh" is the unique original prefix, meaning it's a result of a.mov.
                      # "e8" is the file's unique prefix.
                      # The "1" shows the thumbnail order.
  - gh_cv_thumb_2.jpg
  - ff_9b_thumb_3.jpg
"resized":
  - gh_ll_thumb.jpg
  - gh_df_thumb.jpg
  - ff_jk_thumb.jpg   # is a child of b.mov, as it starts with "ff"

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
format String "tar" The format of the archive to be created. Supported values are "tar" and "zip". Note that "tar" without setting gzip to true results in an archive that's not compressed in any way.
gzip Boolean false Determines if the result archive should also be gzipped. Gzip compression is only applied if you use the "tar" format.
compression_level Integer -6 Determines how fiercly to try to compress the archive. -0 is compressionless, which is suitable for media that is already compressed. -1 is fastest with lowest compression. -9 is slowest with the highest compression. If you are using -0 in combination with the tar format with gzip enabled, consider setting gzip to false instead. This results in a plain Tar archive, meaning it already has no compression.
file_layout String "advanced" Determines if the result archive should contain all files in one directory (value for this is "simple") or in subfolders according to the explanation below (value for this is "advanced"). Files with same names are numbered in the "simple" file layout to avoid naming collisions.

Examples featuring the /file/compress Robot

10.2 Decompress archives

The /file/decompress Robot extracts entire archives of files to be consumed by other Robots or exported as individual files.

The /file/decompress Robot reads, decompresses and extracts all files from an archive file. The following archive formats are supported:

  • ZIP archives (with uncompressed or "deflate"-compressed entries)
  • 7-Zip archives
  • RAR archives
  • GNU tar format (including GNU long filenames, long link names, and sparse files)
  • Solaris 9 extended tar format (including ACLs)
  • Old V7 tar archives
  • POSIX ustar
  • POSIX pax interchange format
  • POSIX octet-oriented cpio
  • SVR4 ASCII cpio
  • POSIX octet-oriented cpio
  • Binary cpio (big-endian or little-endian)
  • ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
  • GNU and BSD "ar" archives
  • "mtree" format
  • Microsoft CAB format
  • LHA and LZH archives
  • XAR archives

This Robot also detects and handles any of the following before evaluating the archive file:

  • uuencoded files
  • Files with RPM wrapper
  • gzip compression
  • bzip2 compression
  • compress/LZW compression
  • lzma, lzip, and xz compression

For security reasons, archives that contain symlinks to outside the archived dir, will error out the Assembly. Decompressing password-protected archives (encrypted archives) is currently not fully supported but will not cause an Assembly to fail.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
ignore_errors Boolean false There might be an error coming up when trying to extract meta data from the files inside your archive. This happens for files that are zero bytes big for example. Setting this to true will cause the Robot to not stop the file decompression (and the entire Assembly) when that happens.

Examples featuring the /file/decompress Robot

11 File Exporting

11.1 Export files to Microsoft Azure

The /azure/store Robot exports encoding results to Microsoft Azure.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your Azure container, account and key. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "account", "key", "container".
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This may include any available Assembly variables.
content_type String "" The content type with which to store the file. By default this will be guessed by Azure.
content_encoding String "" The content encoding with which to store the file. By default this will be guessed by Azure.
content_language String "" The content language with which to store the file. By default this will be guessed by Azure.
cache_control String "" The cache control header with which to store the file.
metadata String {} A JavaScript object containing a list of metadata to be set for this file on Azure, such as { FileURL: "${file.url_name}" }. This can also include any available Assembly variables.
sas_expires_in Integer / Null null Set this to a number to enable shared access signatures for your stored object. This reflects the number of seconds that the signature will be valid for once the object is stored. Enabling this will attach the shared access signature (SAS) to the result URL of your object.
sas_permissions String "" Set this to a combination of r (read), w (write) and d (delete) for your shared access signatures (SAS) permissions.

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Examples featuring the /azure/store Robot

11.2 Export files to Rackspace Cloudfiles

The /cloudfiles/store Robot exports encoding results to Rackspace Cloudfiles.

A Note About URLs

If your container is CDN-enabled, the resulting file.url indicates the path to the file in your CDN container, or is null otherwise.

The storage container URL for this file is always available via file.meta.storage_url.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your Cloudfiles container, user, key, account type and data center. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "account_type" ("us" or "uk"), "data_center" ("dfw" for Dallas or "ord" for Chicago for example), "user", "key", "container".
path String "${file.id}_${file.url_name}" The path at which to store the file. This value can also contain Assembly variables.

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Examples featuring the /cloudfiles/store Robot

11.3 Export files to Dropbox

The /dropbox/store Robot exports encoding results to Dropbox.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your access token. Please create your dropbox access token here. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameter instead: "access_token".
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This may include any available Assembly variables.
create_sharing_link Boolean false Whether to create a URL to this file for sharing with other people. This will overwrite the file's "url" property.

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Examples featuring the /dropbox/store Robot

11.4 Export files to FTP servers

The /ftp/store Robot exports encoding results to your FTP servers. No public key authentication is required. This Robot relies on password access.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your FTP host, user and password. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "host", "user", "password".
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This can contain any available Assembly variables. Please note that you might need to include your homedir at the beginning of the path.
url_template String "http://{HOST}/{PATH}" The URL of the file in the result JSON. The following Assembly variables are supported.
ssl_url_template String "https://{HOST}/{PATH}" The SSL URL of the file in the result JSON. The following Assembly variables are supported.

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Things to Keep in Mind

  • Your server might be unresponsive from time to time. Since (S)FTP servers are harder to scale, we have seen this happen a lot. As a result, if this robot fails to store one of your files, it retries to store the file 5 times over 15 minutes.
  • This also means that when you gave it the wrong credentials (when testing for example) Assemblies can take up to 15min to complete. Please keep this in mind.
  • If an Assembly has an export Step and takes long to execute, it is almost always due to the export Step having wrong credentials or the server being unreachable.

We advise you to use our /sftp/store and /sftp/import Robots when possible, as it is much more secure. The FTP Robots should only serve as a fallback for when SFTP cannot be used.

Examples featuring the /ftp/store Robot

11.5 Export files to Google Storage

The /google/store Robot exports encoding results to Google Storage.

The URL to the result file in your Google bucket will be returned in the Transloadit result JSON.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Create a new Google service account. Set its role to "Storage Object Creator". Choose "JSON" for the key file format and download it to your computer. You will need to upload this file when creating your Template Credentials.

Go back to your Google credentials project and enable the "Google Cloud Storage JSON API" for it. Wait around ten minutes for the action to propagate through the Google network. Grab the project id from the drop down menu in the header bar on the Google site. You will also need it later on.

Now you can set up the storage.objects.create and storage.objects.delete permissions. The latter is optional and only required if you intend to overwrite existing paths.

Then create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value.
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This may include any available Assembly Variables.
acl String "public-read" The permissions used for this file. This can be "public-read", "authenticated-read", "bucket-owner-full-control", "private" or "project-private".

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Examples featuring the /google/store Robot

11.6 Export files to Amazon S3

The /s3/store Robot exports encoding results to Amazon S3.

If you are new to Amazon S3, see our tutorial on using your own S3 bucket.

The URL to the result file in your S3 bucket will be returned in the Transloadit result JSON.

Important Our result URLs use the form http://{bucket}.s3.amazonaws.com/path/to/file, which means that your bucket name must be DNS-compliant. This includes that you do not use uppercase letters in your bucket name. For more information regarding this please see Amazon's recommendations. Please note that any non alphanumeric characters in the file names will be replaced with an underscore, and spaces are replaced with dashes. If your existing S3 bucket contains uppercase letters or is otherwise not DNS-compliant, please make sure to rewrite the result URLs using the Robot's url_prefix parameter.

You will also need to add permissions to your bucket so that Transloadit can access it properly. Here is an example IAM policy that you can use. It contains the minimum required permissions to export a file to your S3 bucket using Transloadit. You may require more permissions (especially viewing permissions) depending on your application.

Please change {BUCKET_NAME} in the values for Sid and Resource accordingly. Also, this policy will grant the minimum required permissions to all your users. We advise you to create a separate Amazon IAM user, and use its User ARN (can be found in the "Summary" tab of a user here) for the Principal value. More information about this can be found here.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowTransloaditToStoreFilesIn{BUCKET_NAME}Bucket",
      "Effect": "Allow",
      "Action": [
        "s3:GetBucketLocation",
        "s3:ListBucket",
        "s3:PutObject",
        "s3:PutObjectAcl"
      ],
      "Resource": [
        "arn:aws:s3:::{BUCKET_NAME}",
        "arn:aws:s3:::{BUCKET_NAME}/*"
      ]
    }
  ]
}

The Sid value is just an identifier for you to recognize the rule later. You can name it anything you like.

The policy needs to be separated into two parts, because the ListBucket action requires permissions on the bucket while the other actions require permissions on the objects in the bucket. When targeting the objects there's a trailing slash and an asterisk in the Resource parameter, whereas when the policy targets the bucket, the slash and the asterisk are omitted.

Please note that if you give the Robot's acl parameter a value of "bucket-default", then you do not need the "s3:PutObjectAcl" permission in your bucket policy.

In order to build proper result URLs we need to know the region in which your S3 bucket resides. For this we require the GetBucketLocation permission. Figuring out your bucket's region this way will also slow down your Assemblies. To make this much faster and to also not require the GetBucketLocation permission, we have added the bucket_region parameter to the /s3/store and /s3/import Robots. We recommend using them at all times.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your S3 bucket, key, secret and bucket region. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "bucket", "bucket_region" (for example: "us-east-1" or "eu-west-2"), "key", "secret".
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This may include any available Assembly variables.
url_prefix String "http://{bucket}.s3.amazonaws.com/" The URL prefix used for the returned URL, such as "http://my.cdn.com/some/path".
acl String "public-read" The permissions used for this file. This can be "public-read", "public", "private" or "bucket-default".
headers Object { "Content-Type": file.mime } A JavaScript object containing a list of headers to be set for this file on S3, such as { FileURL: "${file.url_name}" }. This can also include any available Assembly variables. Here you can find a list of available headers.
host String "s3.amazonaws.com" The host of the storage service used. This only needs to be set when the storage service used is not Amazon S3, but has a compatible API (such as hosteurope.de).
no_vhost Boolean false Set to true if you use a custom host and run into access denied errors.
sign_urls_for Integer not set This parameter provides signed urls in the result JSON (in the signed_url and signed_ssl_url properties). The number that you set this parameter to is the url expiry time in seconds. If this parameter is not used, no url signing is done.

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Examples featuring the /s3/store Robot

11.7 Export files to SFTP servers

The /sftp/store Robot exports encoding results to your own SFTP server.

Exports the input file to the specified server, via SFTP.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your SFTP host, user, port and optional custom public key. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "host", "port", "user", "public_key" (optional).
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This may include any available Assembly variables.
url_template String "http://host/path" The URL of the file in the result JSON. This may include any of the following supported Assembly variables.
ssl_url_template String "https://{HOST}/{PATH}" The SSL URL of the file in the result JSON. The following Assembly variables are supported.
file_chmod String Auto This optional parameter controls how an uploaded file's permission bits are set. You can use any string format that the chmod command would accept, such as "755". If you don't specify this option, the file's permission bits aren't changed at all, meaning it's up to your server's configuration (e.g. umask).

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Things to Keep in Mind

  • Your server might be unresponsive from time to time. Since (S)FTP servers are harder to scale, we have seen this happen a lot. As a result, if this robot fails to store one of your files, it retries to store the file 5 times over 15 minutes.
  • This also means that when you gave it the wrong credentials (when testing for example) Assemblies can take up to 15min to complete. Please keep this in mind.
  • If an Assembly has an export Step and takes long to execute, it is almost always due to the export Step having wrong credentials or the server being unreachable.

This robot uses SSH keys, which is more secure at the trade-off of a bit of complexity in setting up. If you prefer a less secure, but easier-to-setup solution, then please have a look at our /ftp/store and /ftp/import Robots.

Installation on Your Server

The method explained here is slightly more elaborate than handing out an SSH account with an authorized public key, but is more secure, as the user will not be able to traverse outside their home directory. This way, even if the user account is compromised at some point, the accessible data would be recently uploaded files.

The following explains how to create a dedicated user and group for Transloadit, and restrict access as shown in this article.

First let's create a dedicated group & user:

# Change these variables to suit your needs.
# For additional security, use a randomly picked username.
TL_USER="random873"
TL_PUBLIC_PATH="uploads"

groupadd sftponly
useradd -g sftponly -m ${TL_USER}

# This line sets a random 20-character password for the user.
# We work with keys, but this is required because some operating systems will
# consider the account locked without one.
echo "${TL_USER}:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c20)" |chpasswd

mkdir -p /home/${TL_USER}/.ssh /home/${TL_USER}/${TL_PUBLIC_PATH}

echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA57GdwNLqsWz03X8MBEe4KoMSY2HOURjnUUe9zeTivASI+BLEe3cZcuJjsEBaRpISvCH04hosWUI0H4BQeB1dZZUUW1s4ttnVohCD9CfNiXJ7pwJAvgWb01dTW4YUWFKUTpTeUwQzgcNVLDtSVaQOYh4lAKvCZEcz17X9iZ7AeSEuQKe+QsrcwQoBdSpQ6FnzKwSZsggK81dPiGIW9Cw2z/EZWJpl9QBTYhw25NbNRtZj3fXVbrejnQQ985eZ6TlrvQFpUVwyk0QNHDsN+7zVISM3eXNpxof+vJyQNDLN9tb8vNPf/HXuw7MDJWMphrQevF5V26aMzszl3ZeO1779Mw== sftp@transloadit.com" >> /home/${TL_USER}/.ssh/authorized_keys

chown -R ${TL_USER}.sftponly /home/${TL_USER}
chown root.root /home/${TL_USER}

chmod -R 600 /home/${TL_USER}/.ssh /home/${TL_USER}/${TL_PUBLIC_PATH}
chmod -R u+X /home/${TL_USER}/.ssh /home/${TL_USER}/${TL_PUBLIC_PATH}

Make sure to change ${TL_USER} and ${TL_PUBLIC_PATH} to suit your needs. Remember to use a random username for additional security.

Next, we will set up SSH to cage SFTP users in their home directory, and deny them regular shell access.

Enter ${EDITOR} /etc/ssh/sshd_config, and then find and comment out this line:

# Subsystem sftp /usr/lib/openssh/sftp-server

At the bottom of the same file, add the following:

Subsystem sftp internal-sftp

Match group sftponly
    ChrootDirectory /home/%u
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp

Finally, enter /etc/init.d/ssh restart to reflect the changes made.

Examples featuring the /sftp/store Robot

11.8 Export files to Softlayer / IBM Cloud

The /softlayer/store Robot exports encoding results to Softlayer / IBM Cloud.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String Please create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your Softlayer container, user, key and auth endpoint. While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead: "container", "user", "key", "auth_endpoint".
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This may include any available Assembly variables.
headers String {} A JavaScript object containing a list of headers to be set for this file on S3, such as { FileURL: "${file.url_name}" }. This can also include any available Assembly variables.
Note There are no URLs in the result JSON for this robot. You will need to download files from the storage via the Softlayer API.

Examples featuring the /softlayer/store Robot

11.9 Export files to YouTube

The /youtube/store Robot exports encoding results to YouTube.

Note that this Robot only accepts videos.

Installation

Since YouTube works with OAuth you will need to generate Template Credentials in order to use this Robot.

To change the title, description, category, or keywords per video we recommend to inject variables into your Template.

Parameters

Name Type Default Description
use (required) String / Array of Strings

General

Specifies which Step(s) to use as the input to this Robot.

Special Step names

A special Step name is ":original", which provides user uploads handled by Transloadit.

Providing several Steps as input

You can add arrays to use several Steps:
"use": [
  ":original",
  "encoded",
  "resized"
]

Step bundling

Some Robots can gather several Step results for a single invocation. For example, the /file/compress Robot would normally create one Zip file for each file passed to it. If you'd set bundle_steps to true, however, it will create one archive containing all the result files from all Steps you give it. To enable bundling, provide an object like the one below to the use parameter:
  "use": {
    "steps": [
      ":original",
      "encoded",
      "resized"
    ],
    "bundle_steps": true
  }
This is a crucial parameter for the /video/adaptive Robot, otherwise you'll generate 1 playlist for each viewing quality.
Keep in mind that all input Steps must be present in your Template. If one of them is missing, no result is generated because the Robot waits indefinitely for all input Steps to be finished.

Group by original

Sticking with the /file/compress Robot example, you can set group_by_original to true, in order to create a separate Zip file for each of your uploaded or imported files, instead of creating one archive containing all originals (or one per resulting file). This is a crucial parameter for the /media/playlist Robot.

Demo

See a demo for the use parameter here.
credentials (required) String The authentication Template credentials used for your YouTube account. You can generate them on the Template Credentials page.
title (required) String The title of the video to be displayed on YouTube. Note that since the YouTube API requires titles to be within 80 characters, longer titles may be truncated.
description (required) String The description of the video to be displayed on YouTube.
category (required) String The category to which this video will be assigned. These are the valid values: "action/adventure", "anime/animation", "autos & vehicles", "classics", "comedy", "documentary", "drama", "education", "entertainment", "family", "film & animation", "foreign", "gaming", "horror", "howto & style", "movies", "music", "news & politics", "people & blogs", "pets & animals", "sci-Fi/fantasy", "science & technology", "short movies", "shorts", "shows", "sports", "thriller", "trailers", "travel & events", "videoblogging"
keywords (required) String Tags used to describe the video, separated by commas. These tags will also be displayed on YouTube.
visibility (required) String Defines the visibility of the uploaded video. This can be "public", "private", or "unlisted".

Note The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database. You can influence the URL using the Robot's url_template parameter which is explained in the table below.

Examples featuring the /youtube/store Robot