The /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.

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.

Live demos

Our /video/adaptive Robot can be used in combination with other Robots, to create powerful workflows unique to your use case.
Here are a few example scenarios, and the required the Assembly Instructions to implement them.
You can also try demos of these examples right here, live on our website.

Implement HTTP Live Streaming (HLS)

{
  "steps": {
    "low": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "hls_270p"
    },
    "mid": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "hls_360p"
    },
    "high": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "hls_540p"
    },
    "adaptive": {
      "use": {"steps":["low", "mid", "high"],"bundle_steps":true},
      "robot": "/video/adaptive",
      "ffmpeg_stack": "v3.3.3",
      "playlist_name": "my_playlist.m3u8",
      "technique": "hls"
    },
    "exported": {
      "use": ["adaptive", ":original"],
      "robot": "/s3/store",
      "bucket": "demos.transloadit.com",
      "bucket_region": "us-east-1",
      "key": "YOUR_AWS_KEY",
      "path": "hlstest/${file.meta.relative_path}/${file.name}",
      "secret": "YOUR_AWS_SECRET"
    }
  }
}

Implement MPEG-Dash using Transloadit

{
  "steps": {
    "270p_video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash_270p_video"
    },
    "360p_video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash_360p_video"
    },
    "32k_audio": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash_32k_audio"
    },
    "64k_audio": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash_64k_audio"
    },
    "adaptive": {
      "use": {"steps":["270p_video", "360p_video", "32k_audio", "64k_audio"],"bundle_steps":true},
      "robot": "/video/adaptive",
      "ffmpeg_stack": "v3.3.3",
      "playlist_name": "my_playlist.mpd",
      "technique": "dash"
    },
    "exported": {
      "use": [":original", "adaptive"],
      "robot": "/s3/store",
      "bucket": "demos.transloadit.com",
      "bucket_region": "us-east-1",
      "key": "YOUR_AWS_KEY",
      "path": "dashtest/${file.meta.relative_path}/${file.name}",
      "secret": "YOUR_AWS_SECRET"
    }
  }
}

Our /video/adaptive robot blog posts

Over the years we wrote the following posts about Our /video/adaptive robot on our blog:

Did you know?

You can easily combine Robots to create powerful workflows, unique to your business.
This is the power of Transloadit.