The /video/adaptive Robot

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos.

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

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 Assembly Instructions to implement them.
You can also try demos of these examples right here, live on our website.

Make video compatible for all devices

{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "plain_720_vp9_encoded": {
      "use": [":original"],
      "robot": "/video/encode",
      "result": true,
      "ffmpeg_stack": "v3.3.3",
      "height": 720,
      "preset": "webm",
      "width": 1280
    },
    "plain_720_h264_encoded": {
      "use": [":original"],
      "robot": "/video/encode",
      "result": true,
      "ffmpeg_stack": "v3.3.3",
      "height": 720,
      "preset": "ipad-high",
      "width": 1280
    },
    "thumbnailed": {
      "use": ["plain_720_h264_encoded"],
      "robot": "/video/thumbs",
      "result": true,
      "count": 1,
      "ffmpeg_stack": "v3.3.3",
      "format": "jpg",
      "height": 720,
      "resize_strategy": "fit",
      "width": 1280
    },
    "dash-720p-video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash-720p-video"
    },
    "dash-360p-video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash-360p-video"
    },
    "dash-270p-video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash-270p-video"
    },
    "dash-32k-audio": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash-32k-audio"
    },
    "dash-64k-audio": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "dash-64k-audio"
    },
    "hls-720p-video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "hls-720p"
    },
    "hls-360p-video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "hls-360p"
    },
    "hls-270p-video": {
      "use": [":original"],
      "robot": "/video/encode",
      "ffmpeg_stack": "v3.3.3",
      "preset": "hls-270p"
    },
    "dash-adapted": {
      "use": {"steps":["dash-720p-video", "dash-360p-video", "dash-270p-video", "dash-64k-audio", "dash-32k-audio"],"bundle_steps":true},
      "robot": "/video/adaptive",
      "result": true,
      "ffmpeg_stack": "v3.3.3",
      "playlist_name": "dash-playlist.mpd",
      "technique": "dash"
    },
    "hls-adapted": {
      "use": {"steps":["hls-720p-video", "hls-360p-video", "hls-270p-video"],"bundle_steps":true},
      "robot": "/video/adaptive",
      "result": true,
      "ffmpeg_stack": "v3.3.3",
      "playlist_name": "hls-playlist.m3u8",
      "technique": "hls"
    },
    "adaptive_exported": {
      "use": ["dash-adapted", "hls-adapted"],
      "robot": "/s3/store",
      "credentials": "demo_s3_credentials",
      "path": "${unique_original_prefix}-${file.original_basename}/adapt/${file.meta.relative_path}/${file.name}"
    },
    "plain_exported": {
      "use": [":original", "plain_720_vp9_encoded", "plain_720_h264_encoded", "thumbnailed"],
      "robot": "/s3/store",
      "credentials": "demo_s3_credentials",
      "path": "${unique_original_prefix}-${file.original_basename}/plain/${previous_step.name}.${file.ext}"
    }
  }
}

Implement HTTP Live Streaming (HLS)

{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "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",
      "credentials": "demo_s3_credentials",
      "path": "hlstest/${file.meta.relative_path}/${file.name}"
    }
  }
}

Implement MPEG-Dash using Transloadit

{
  "steps": {
    ":original": {
      "robot": "/upload/handle"
    },
    "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",
      "credentials": "demo_s3_credentials",
      "path": "dashtest/${file.meta.relative_path}/${file.name}"
    }
  }
}

Blog posts about our /video/adaptive Robot

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.