The /video/adaptive Robot

Our /video/adaptive robot

Transloadit offers a variety of features to reduce video size while maintaining quality, as well as add effects like watermarks.

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's 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 "uses" the originally uploaded files.

Providing several Steps as input
You can also add arrays here to use several steps:
use: [ ":original", "encode2", "encode3" ]

Step bundling
This Robot allows you to bundle several Steps that are to be used as the input. In fact, for this Robot you should use Step bundling, otherwise you will create one playlist file for each passed segment. If you set bundle_steps to true, however, it will create one playlist containing all the provided segments. To achieve this, provide an object like the one below to the use parameter:
use: { steps: ["hls_step_name", "hls_step_name2"], "bundle_steps": true }
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. 10 seconds is usually a good value here.
closed_captions Boolean true Determines whether you want closed caption support when using the "hls" technique.

Example use cases featuring the /video/adaptive robot

See the robot in action with some live demos and code samples right here on our website:

Implement HTTP Live Streaming (HLS)

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "low": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "hls_270p"
    },
    "mid": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "hls_360p"
    },
    "high": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "hls_540p"
    },
    "adaptive": {
      "robot": "/video/adaptive",
      "use": {
        "steps": [
          "low",
          "mid",
          "high"
        ],
        "bundle_steps": true
      },
      "technique": "hls",
      "playlist_name": "my_playlist.m3u8"
    },
    "store": {
      "robot": "/s3/store",
      "use": "adaptive",
      "path": "hlstest/${file.meta.relative_path}/${file.name}",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Implement MPEG-Dash using Transloadit

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "270p_video": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_270p_video"
    },
    "360p_video": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_360p_video"
    },
    "32k_audio": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_32k_audio"
    },
    "64k_audio": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_64k_audio"
    },
    "adaptive": {
      "robot": "/video/adaptive",
      "use": {
        "steps": [
          "270p_video",
          "360p_video",
          "32k_audio",
          "64k_audio"
        ],
        "bundle_steps": true
      },
      "technique": "dash",
      "playlist_name": "my_playlist.mpd"
    },
    "store": {
      "robot": "/s3/store",
      "use": "adaptive",
      "path": "dashtest/${file.meta.relative_path}/${file.name}",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}


Did you know?

You can easily combine Robots to create powerful workflows, unique to your business.

This is the power of Transloadit.