# Make video compatible for all devices

If you have users on many different devices, and you want to offer them the optimal experience, you want to deliver the smallest files possible, so you want to make sure that you're not shipping:

1. pixels beyond what their screen can render
2. quality beyond what their bandwidth can carry
3. codecs that their device can't understand (an obvious prerequisite)

MPEG-DASH is a great new standard that can adjust video quality for users, while it is playing. This means that quality can be scaled all the way down to audio-only as users move through tunnels, and pick back up to full HD (or more) when they're on Wi-Fi.

Native [support for MPEG-DASH⁠](https://caniuse.com/#search=mse) across browsers in 2018 is lacking. Luckily there is [dash.js⁠](https://github.com/Dash-Industry-Forum/dash.js/wiki), a JavaScript library that can add MPEG-DASH support to[browsers that support Media Source Extensions⁠](https://caniuse.com/#search=mse). As you can see, in early 2018 that means iOS is out of the window. Sad.

Before MPEG-DASH was conceived, Apple already had this Adaptive technology as a proprietary undertaking, called HLS. So if you'd want to offer the best experience, ideally you make the player switch between HLS and MPEG-DASH, so long as Apple isn't on board yet. And then maybe you want to add 'old school' mp4 and webm files, just for devices or players that aren't (in) browsers and won't support Adaptive streaming for some time to come.

In this, admittedly, rather long example, we're going to illustrate how to generate all these different formats, along with a code snippet of how your player could switch between those.

We can use WebM's VP9 codec for modern browsers and fall back to MP4s for the rest like so:

```html
<html>
  <head>
    <title>Readaptive</title>
    <link rel="stylesheet" href="https://cdn.plyr.io/2.0.7/plyr.css">
    <style>
      .plyr-container,
      .plyr-player {
        width: 720px;
        height: 540px;
      }
    </style>
  </head>
  <body>
    <h1>Readaptive</h1>
    <p>
      Here's a script that offers the browser HLS, DASH or MP4/WEBM fallbacks based on capability.
      <br>
      To force a selection click (and then refresh):

      <ul>
        <li><a href="#">auto</a></li>
        <li><a href="#hls">hls</a></li>
        <li><a href="#dash">dash</a></li>
        <li><a href="#non-adaptive">non-adaptive</a></li>
      </ul>
    </p>
    <br>
    <div class="plyr-container">
      <video
        controls
        playsinline
        class="plyr-player"
        poster="https://tamhub.edgly.net/plain/b3/7eba411c6d11e8bbdb594d427f9a9f-aligators/thumbnailed.jpg"
      >
        <source
          src="https://tamhub.edgly.net/plain/b3/7eba411c6d11e8bbdb594d427f9a9f-aligators/plain_720_vp9_encoded.webm"
          type="video/webm; codecs=vp9,vorbis"
        >
        <source
          src="https://tamhub.edgly.net/plain/b3/7eba411c6d11e8bbdb594d427f9a9f-aligators/plain_720_h264_encoded.mp4"
          type="video/mp4"
        >
        <source src="https://tamhub.edgly.net/adapt/b3/7eba411c6d11e8bbdb594d427f9a9f-aligators/hls-playlist.m3u8">
        <source src="https://tamhub.edgly.net/adapt/b3/7eba411c6d11e8bbdb594d427f9a9f-aligators/dash-playlist.mpd">
      </video>
    </div>
  </body>
  <script src="http://cdn.dashjs.org/latest/dash.all.min.js"></script>
  <script src="https://cdn.plyr.io/2.0.7/plyr.js"></script>
  <script src="https://unpkg.com/hls.js@0.8.9/dist/hls.js"></script>

  <script>
    function readaptive(selector, options) {
      if (!options) options = {}
      if (!('force' in options)) options.force = location.hash.replace('#', '')

      var dashjs = window.dashjs
      var plyr = window.plyr
      var Hls = window.Hls

      var supportsDash = typeof (window.MediaSource || window.WebKitMediaSource) === 'function'
      var supportsHls = Hls.isSupported()

      var player,
        i,
        players = document.querySelectorAll(selector)
      var adaptiveSources = []
      var nonAdaptiveSources = []
      for (var i = 0; i < players.length; i++) {
        player = players[i]
        var source,
          j,
          sources = player.getElementsByTagName('source')

        var autoplay = false
        if ('autoplay' in options) {
          autoplay = options.autoplay
        } else if (player.getAttribute('autoplay')) {
          autoplay = true
        }

        if (sources.length < 1) {
          return console.error('No sources found in player')
        }
        for (var j = 0; j < sources.length; j++) {
          source = sources[j]

          var src = source.getAttribute('src')
          var type
          if ((type = source.getAttribute('type'))) {
            type = type.split(' ')[0].split(';')[0].split('/')[1]
          }
          if (`${src}`.match(/\.m3u8$/)) {
            type = 'hls'
          } else if (`${src}`.match(/\.mpd$/)) {
            type = 'dash'
          } else if (!type) {
            type = src.split('.').pop()
          }

          if (type === 'hls') {
            if (supportsHls && (!options.force || options.force === 'hls')) {
              // https://codepen.io/sampotts/pen/JKEMqB
              var hls = new Hls()
              hls.loadSource(src)
              hls.attachMedia(player)
              hls.on(Hls.Events.MANIFEST_PARSED, function () {
                if (autoplay) {
                  player.play()
                }
              })
              adaptiveSources.push({ type, source })
            }
          } else if (type === 'dash') {
            if (supportsDash && (!options.force || options.force === 'dash')) {
              // https://codepen.io/sampotts/pen/BzpJXN
              var dash = dashjs.MediaPlayer().create()
              dash.initialize(player, src, autoplay)
              adaptiveSources.push({ type, source })
            }
          } else {
            // Non adaptive source. Let's add it so that the browser will pick the best candidate for playback
            nonAdaptiveSources.push({ type, source })
          }
        }

        player.innerHTML = ''
        var picked = []
        if (adaptiveSources.length !== 0) {
          for (var k in adaptiveSources) {
            // Only use 1 Adaptive source; so break
            player.appendChild(adaptiveSources[k].source)
            picked.push(adaptiveSources[k].type)
            break
          }
        } else if (nonAdaptiveSources.length !== 0) {
          for (var k in nonAdaptiveSources) {
            // Allow the browser to pick from all non-adaptive sources
            player.appendChild(nonAdaptiveSources[k].source)
            picked.push(nonAdaptiveSources[k].type)
          }
        } else {
          return console.error('No non-adaptive sources collected')
        }

        // https://github.com/sampotts/plyr#options
        var player = plyr.setup(this, {
          debug: false,
          autoplay: autoplay,

          controls: ['play', 'progress', 'current-time'],
        })[0]

        // https://github.com/sampotts/plyr#events
        player.on('ready', function (event) {
          // console.log({event})
        })
      }

      return { picked }
    }

    var { picked, player } = readaptive('.plyr-player')
    var newParagraph = document.createElement('p')
    newParagraph.textContent = 'Offering the browser: ' + picked.join(', ')
    document.getElementsByClassName('plyr-container')[0].appendChild(newParagraph)
  </script>
</html>

```

Step 1

### Handle uploads

We can handle uploads of your users directly. [Learn more ›](/services/handling-uploads.md)

[:original.mp4](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/:original.mp4)

Video · 4.3 MB · 27s · 1024 × 768

```
":original": {
  "robot": "/upload/handle"
}
```

🤖 [/upload/handle](/docs/robots/upload-handle.md)

This bot receives uploads that your users throw at you from browser or apps, or that you throw at us programmatically

Step 2

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[plain\_720\_vp9\_encoded.webm](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/plain%5F720%5Fvp9%5Fencoded.webm)

Video · 2.7 MB · 27s · 1280 × 720

```
"plain_720_vp9_encoded": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "height": 720,
  "preset": "webm",
  "turbo": false,
  "width": 1280
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 3

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[plain\_720\_h264\_encoded.mp4](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/plain%5F720%5Fh264%5Fencoded.mp4)

Video · 4.3 MB · 27s · 1280 × 720

```
"plain_720_h264_encoded": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "height": 720,
  "preset": "ipad-high",
  "turbo": false,
  "width": 1280
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 4

### Extract thumbnails from videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

![thumbnailed.jpg](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/thumbnailed.jpg)

[thumbnailed.jpg](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/thumbnailed.jpg)

Image · 25 KB · 1280 × 720

```
"thumbnailed": {
  "use": "plain_720_h264_encoded",
  "robot": "/video/thumbs",
  "result": true,
  "count": 1,
  "ffmpeg_stack": "v7",
  "format": "jpg",
  "height": 720,
  "resize_strategy": "fit",
  "width": 1280
}
```

🤖 [/video/thumbs](/docs/robots/video-thumbs.md)

This bot extracts any number of images from videos for use as previews

Step 5

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[87ce9f2393214d60b84fbafc28fc4a63.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/87ce9f2393214d60b84fbafc28fc4a63.mp4)

Video · 11 MB · 27s · 1280 × 720

```
"dash_720p_video": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "dash_720p_video",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 6

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[e728544e1c7e40db9e9cc344d74045bc.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/e728544e1c7e40db9e9cc344d74045bc.mp4)

Video · 2.6 MB · 27s · 640 × 360

```
"dash_360p_video": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "dash_360p_video",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 7

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[2f8b0fb6ce6d41d3861ed4c2002c82fb.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/2f8b0fb6ce6d41d3861ed4c2002c82fb.mp4)

Video · 1.5 MB · 27s · 480 × 270

```
"dash_270p_video": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "dash_270p_video",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 8

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[773dccdde3764d33bca7340769a87329.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/773dccdde3764d33bca7340769a87329.mp4)

Audio · 112 KB · 27s

```
"dash-32k-audio": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "dash-32k-audio",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 9

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[d4ae46e7d2d44c3ebf34dbef719d1235.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/d4ae46e7d2d44c3ebf34dbef719d1235.mp4)

Audio · 218 KB · 27s

```
"dash-64k-audio": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "dash-64k-audio",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 10

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[10ddbb5e21c742a28e95f3ffd1958389.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/10ddbb5e21c742a28e95f3ffd1958389.mp4)

Video · 14 MB · 27s · 1280 × 720

```
"hls-720p-video": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "hls-720p",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 11

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[e7db7eb9719441669a63f2bdd4e4b342.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/e7db7eb9719441669a63f2bdd4e4b342.mp4)

Video · 3.5 MB · 27s · 640 × 360

```
"hls-360p-video": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "hls-360p",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 12

### Transcode, resize, or watermark videos

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[4ff9b65bce724a2ba94780b85203b0b1.mp4](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/4ff9b65bce724a2ba94780b85203b0b1.mp4)

Video · 2.0 MB · 27s · 480 × 270

```
"hls-270p-video": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v7",
  "preset": "hls-270p",
  "turbo": false
}
```

🤖 [/video/encode](/docs/robots/video-encode.md)

This bot encodes, resizes, applies watermarks to videos and animated GIFs

Step 13

### Convert videos to HLS, MPEG-Dash and CMAF

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[480x270\_471885\_30\_dashinit.mp4](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/480x270%5F471885%5F30%5Fdashinit.mp4)

Video · 1.5 MB · 27s · 480 × 270

[dash-playlist.mpd](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/dash-playlist.mpd)

Video · 2.7 KB · 27s · 1280 × 720

[640x360\_817343\_30\_dashinit.mp4](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/640x360%5F817343%5F30%5Fdashinit.mp4)

Video · 2.6 MB · 27s · 640 × 360

[64270\_44100\_dashinit.mp4](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/audio/64270%5F44100%5Fdashinit.mp4)

Audio · 219 KB · 27s · 1280 × 720

[32377\_44100\_dashinit.mp4](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/audio/32377%5F44100%5Fdashinit.mp4)

Audio · 113 KB · 27s · 1280 × 720

[1280x720\_3345814\_30\_dashinit.mp4](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/1280x720%5F3345814%5F30%5Fdashinit.mp4)

Video · 11 MB · 27s · 1280 × 720

```
"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,
  "playlist_name": "dash-playlist.mpd",
  "technique": "dash"
}
```

🤖 [/video/adaptive](/docs/robots/video-adaptive.md)

This bot encodes videos into HTTP Live Streaming (HLS), MPEG-Dash and CMAF supported formats and generates the necessary manifest and playlist files

Step 14

### Convert videos to HLS, MPEG-Dash and CMAF

We offer a variety of video encoding features like optimizing for different devices, merging, injecting ads, changing audio tracks, or adding company logos. [Learn more ›](/services/video-encoding.md)

[seg\_\_2.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/seg%5F%5F2.ts)

Video · 945 KB · 6s · 640 × 360

![hls-playlist.m3u8](https://tl-preview.tlcdn.com/demo-preview/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/hls-playlist.m3u8?w=214\&h=300\&cb=11)

[hls-playlist.m3u8](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/hls-playlist.m3u8)

application/x-mpegURL · 534 B

![640x360\_1010474\_30.m3u8](https://tl-preview.tlcdn.com/demo-preview/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360_1010474_30/640x360_1010474_30.m3u8?w=214\&h=300\&cb=11)

[640x360\_1010474\_30.m3u8](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/640x360%5F1010474%5F30.m3u8)

application/x-mpegURL · 200 B

[seg\_\_0.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/seg%5F%5F0.ts)

Video · 1.5 MB · 11s · 640 × 360

![480x270\_565420\_30.m3u8](https://tl-preview.tlcdn.com/demo-preview/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270_565420_30/480x270_565420_30.m3u8?w=214\&h=300\&cb=11)

[480x270\_565420\_30.m3u8](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/480x270%5F565420%5F30.m3u8)

application/x-mpegURL · 200 B

[seg\_\_1.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/seg%5F%5F1.ts)

Video · 744 KB · 10s · 480 × 270

[seg\_\_2.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/seg%5F%5F2.ts)

Video · 619 KB · 7s · 480 × 270

![1280x720\_4037964\_30.m3u8](https://tl-preview.tlcdn.com/demo-preview/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720_4037964_30/1280x720_4037964_30.m3u8?w=214\&h=300\&cb=11)

[1280x720\_4037964\_30.m3u8](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/1280x720%5F4037964%5F30.m3u8)

application/x-mpegURL · 199 B

[seg\_\_0.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/seg%5F%5F0.ts)

Video · 769 KB · 10s · 480 × 270

[seg\_\_1.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/seg%5F%5F1.ts)

Video · 1.3 MB · 10s · 640 × 360

[seg\_\_2.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/seg%5F%5F2.ts)

Video · 3.8 MB · 7s · 1280 × 720

[seg\_\_1.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/seg%5F%5F1.ts)

Video · 4.8 MB · 10s · 1280 × 720

[seg\_\_0.ts](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/seg%5F%5F0.ts)

Video · 5.4 MB · 11s · 1280 × 720

```
"hls_adapted": {
  "use": {
    "steps": [
      "hls-720p-video",
      "hls-360p-video",
      "hls-270p-video"
    ],
    "bundle_steps": true
  },
  "robot": "/video/adaptive",
  "result": true,
  "playlist_name": "hls-playlist.m3u8",
  "technique": "hls"
}
```

🤖 [/video/adaptive](/docs/robots/video-adaptive.md)

This bot encodes videos into HTTP Live Streaming (HLS), MPEG-Dash and CMAF supported formats and generates the necessary manifest and playlist files

Step 15

### Export files to Amazon S3

We export to the storage platform of your choice. [Learn more ›](/services/file-exporting.md)

```
"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}",
  "url_prefix": "https://demos.transloadit.com/"
}
```

🤖 [/s3/store](/docs/robots/s3-store.md)

This bot exports encoding results to Amazon S3

Step 16

### Export files to Amazon S3

We export to the storage platform of your choice. [Learn more ›](/services/file-exporting.md)

`:original`

* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/:original.mp4⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/:original.mp4)

`plain_720_vp9_encoded`

* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/plain\_720\_vp9\_encoded.webm⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/plain%5F720%5Fvp9%5Fencoded.webm)

`plain_720_h264_encoded`

* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/plain\_720\_h264\_encoded.mp4⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/plain%5F720%5Fh264%5Fencoded.mp4)

`thumbnailed`

* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/thumbnailed.jpg⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/plain/thumbnailed.jpg)

`dash_720p_video`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/87ce9f2393214d60b84fbafc28fc4a63.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/87ce9f2393214d60b84fbafc28fc4a63.mp4)

`dash_360p_video`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/e728544e1c7e40db9e9cc344d74045bc.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/e728544e1c7e40db9e9cc344d74045bc.mp4)

`dash_270p_video`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/2f8b0fb6ce6d41d3861ed4c2002c82fb.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/2f8b0fb6ce6d41d3861ed4c2002c82fb.mp4)

`dash-32k-audio`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/773dccdde3764d33bca7340769a87329.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/773dccdde3764d33bca7340769a87329.mp4)

`dash-64k-audio`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/d4ae46e7d2d44c3ebf34dbef719d1235.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/d4ae46e7d2d44c3ebf34dbef719d1235.mp4)

`hls-720p-video`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/10ddbb5e21c742a28e95f3ffd1958389.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/10ddbb5e21c742a28e95f3ffd1958389.mp4)

`hls-360p-video`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/e7db7eb9719441669a63f2bdd4e4b342.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/e7db7eb9719441669a63f2bdd4e4b342.mp4)

`hls-270p-video`

* [https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/4ff9b65bce724a2ba94780b85203b0b1.mp4⁠](https://tmp-eu-west-1.transloadit.net/4ce4fb3d9d1842b6ba5d6f3ccee4b066/059508b8ae434931a2ebcce6c5225ac1/4ff9b65bce724a2ba94780b85203b0b1.mp4)

`dash_adapted`

* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/480x270\_471885\_30\_dashinit.mp4⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/480x270%5F471885%5F30%5Fdashinit.mp4)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/dash-playlist.mpd⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/dash-playlist.mpd)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/640x360\_817343\_30\_dashinit.mp4⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/640x360%5F817343%5F30%5Fdashinit.mp4)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/audio/64270\_44100\_dashinit.mp4⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/audio/64270%5F44100%5Fdashinit.mp4)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/audio/32377\_44100\_dashinit.mp4⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/audio/32377%5F44100%5Fdashinit.mp4)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/1280x720\_3345814\_30\_dashinit.mp4⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/video/1280x720%5F3345814%5F30%5Fdashinit.mp4)

`hls_adapted`

* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360\_1010474\_30/seg\_\_2.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/seg%5F%5F2.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/hls-playlist.m3u8⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/hls-playlist.m3u8)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360\_1010474\_30/640x360\_1010474\_30.m3u8⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/640x360%5F1010474%5F30.m3u8)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360\_1010474\_30/seg\_\_0.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/seg%5F%5F0.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270\_565420\_30/480x270\_565420\_30.m3u8⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/480x270%5F565420%5F30.m3u8)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270\_565420\_30/seg\_\_1.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/seg%5F%5F1.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270\_565420\_30/seg\_\_2.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/seg%5F%5F2.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720\_4037964\_30/1280x720\_4037964\_30.m3u8⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/1280x720%5F4037964%5F30.m3u8)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270\_565420\_30/seg\_\_0.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/480x270%5F565420%5F30/seg%5F%5F0.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360\_1010474\_30/seg\_\_1.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/640x360%5F1010474%5F30/seg%5F%5F1.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720\_4037964\_30/seg\_\_2.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/seg%5F%5F2.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720\_4037964\_30/seg\_\_1.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/seg%5F%5F1.ts)
* [https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720\_4037964\_30/seg\_\_0.ts⁠](https://demos.transloadit.com/9c/e7090f34bc4818beec6eb0a60f6d12-kite25/adapt/1280x720%5F4037964%5F30/seg%5F%5F0.ts)

```
"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}",
  "url_prefix": "https://demos.transloadit.com/"
}
```

🤖 [/s3/store](/docs/robots/s3-store.md)

This bot exports encoding results to Amazon S3

## Live Demo. See for yourself

Loading Uppy demo…

This live demo is powered by [Uppy⁠](https://uppy.io/docs/guides/uppy-transloadit/), our open source file uploader that you can also use without Transloadit, and [tus⁠](https://tus.io), our open protocol for resumable file uploads that is making uploading more reliable across the world.

## Build this in your own language

```
<!-- This pulls Uppy from our CDN -->
<!-- For smaller self-hosted bundles, install Uppy and plugins manually: -->
<!-- npm i --save @uppy/core @uppy/dashboard @uppy/remote-sources @uppy/transloadit ... -->
<link
  href="https://releases.transloadit.com/uppy/v3.10.0/uppy.min.css"
  rel="stylesheet"
/>
<button id="browse">Select Files</button>
<script type="module">
  import {
    Uppy,
    Dashboard,
    ImageEditor,
    RemoteSources,
    Transloadit,
  } from 'https://releases.transloadit.com/uppy/v3.10.0/uppy.min.mjs'
  const uppy = new Uppy()
    .use(Transloadit, {
      waitForEncoding: true,
      alwaysRunAssembly: true,
      assemblyOptions: {
        params: {
          // It's often better store encoding instructions in your account
          // and use a `template_id` instead of adding these steps inline
          steps: {
            ':original': {
              robot: '/upload/handle',
            },
            plain_720_vp9_encoded: {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              height: 720,
              preset: 'webm',
              turbo: false,
              width: 1280,
            },
            plain_720_h264_encoded: {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              height: 720,
              preset: 'ipad-high',
              turbo: false,
              width: 1280,
            },
            thumbnailed: {
              use: 'plain_720_h264_encoded',
              robot: '/video/thumbs',
              result: true,
              count: 1,
              ffmpeg_stack: 'v7',
              format: 'jpg',
              height: 720,
              resize_strategy: 'fit',
              width: 1280,
            },
            dash_720p_video: {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'dash_720p_video',
              turbo: false,
            },
            dash_360p_video: {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'dash_360p_video',
              turbo: false,
            },
            dash_270p_video: {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'dash_270p_video',
              turbo: false,
            },
            'dash-32k-audio': {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'dash-32k-audio',
              turbo: false,
            },
            'dash-64k-audio': {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'dash-64k-audio',
              turbo: false,
            },
            'hls-720p-video': {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'hls-720p',
              turbo: false,
            },
            'hls-360p-video': {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'hls-360p',
              turbo: false,
            },
            'hls-270p-video': {
              use: ':original',
              robot: '/video/encode',
              result: true,
              ffmpeg_stack: 'v7',
              preset: 'hls-270p',
              turbo: false,
            },
            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,
              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,
              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}',
              url_prefix: 'https://demos.transloadit.com/',
            },
            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}',
              url_prefix: 'https://demos.transloadit.com/',
            },
          },
        },
      },
    })
    .use(Dashboard, { trigger: '#browse' })
    .use(ImageEditor, { target: Dashboard })
    .use(RemoteSources, {
      companionUrl: 'https://api2.transloadit.com/companion',
    })
    .on('complete', ({ transloadit }) => {
      // Due to `waitForEncoding:true` this is fired after encoding is done.
      // Alternatively, set `waitForEncoding` to `false` and provide a `notify_url`
      console.log(transloadit) // Array of Assembly Statuses
      for (const assembly of transloadit) {
        console.log(assembly.results) // Array of all encoding results
      }
    })
    .on('error', (error) => {
      console.error(error)
    })
</script>

```

[Read docs: Browsers](/docs/sdks/uppy.md)

## So many ways to integrate

Transloadit is a service for companies with developers. And there are many ways developers can put Transloadit to good use inside your company to automate media processing.

#### Bulk imports

Add one of our [import Robots](/services/file-importing.md) to acquire and transcode massive media libraries.

#### Handling uploads

We are *the* experts at reliably [handling uploads](/services/handling-uploads.md). We wrote the [protocol⁠](https://tus.io/) for it.

#### Front-end integration

We integrate with web browsers via our next-gen file uploader [Uppy⁠](https://uppy.io/docs/guides/uppy-transloadit/) and SDKs for Android and iOS.

#### Back-end integration

Send us batch jobs in any server language using one of our [SDKs](/docs/sdks.md) or directly interfacing with our [REST API](/docs/api.md).

#### Pingbacks

Configure a [notify\_url](/services/content-delivery.md) to let your server receive transcoding results JSON in the `transloadit` POST field.

#### On-demand

Use our [Smart CDN](/services/file-importing.md) to adapt files on-demand and stream them directly to your users.

[Browsers](/docs/sdks/uppy.md)[TransloaditKit](/docs/sdks/transloaditkit.md)[Ruby SDK](/docs/sdks/ruby-sdk.md)[HTTP REST API](/docs/api.md)[Python SDK](/docs/sdks/python-sdk.md)[PHP SDK](/docs/sdks/php-sdk.md)[Node.js SDK](/docs/sdks/node-sdk.md)[Java SDK](/docs/sdks/java-sdk.md)[Go SDK](/docs/sdks/go-sdk.md)[cURL](/docs/sdks/curl.md)[Convex](/docs/sdks/convex.md)

[Browsers](/docs/sdks/uppy.md)[TransloaditKit](/docs/sdks/transloaditkit.md)[Ruby SDK](/docs/sdks/ruby-sdk.md)[HTTP REST API](/docs/api.md)[Python SDK](/docs/sdks/python-sdk.md)[PHP SDK](/docs/sdks/php-sdk.md)[Node.js SDK](/docs/sdks/node-sdk.md)[Java SDK](/docs/sdks/java-sdk.md)[Go SDK](/docs/sdks/go-sdk.md)[cURL](/docs/sdks/curl.md)[Convex](/docs/sdks/convex.md)

[Browsers](/docs/sdks/uppy.md)[TransloaditKit](/docs/sdks/transloaditkit.md)[Ruby SDK](/docs/sdks/ruby-sdk.md)[HTTP REST API](/docs/api.md)[Python SDK](/docs/sdks/python-sdk.md)[PHP SDK](/docs/sdks/php-sdk.md)[Node.js SDK](/docs/sdks/node-sdk.md)[Java SDK](/docs/sdks/java-sdk.md)[Go SDK](/docs/sdks/go-sdk.md)[cURL](/docs/sdks/curl.md)[Convex](/docs/sdks/convex.md)

## Other cool demos

* [View demo→Video EncodingAdd an audio track to video footage](/demos/video-encoding/add-audio-track-to-video-footage.md)
* [View demo→Video EncodingAdd an empty audio track to still video](/demos/video-encoding/add-empty-audio-track-to-still-video.md)
* [View demo→Document ProcessingAdd a header or footer to a PDF](/demos/document-processing/add-header-or-footer-to-pdf.md)

Try Transloadit

## Ready to get started?

Join thousands of developers who trust Transloadit for their file processing needs.

Building file processing from scratch

Ready-to-use API & SDKs

Scaling infrastructure headaches

Auto-scaling global infrastructure

Managing codec updates

Always up-to-date processing

Handling file security

Enterprise-grade security

Supporting all file formats

1000+ formats & codecs supported

Fragmented media tooling

One API for file workflows

GDPR

GDPR

HIPAA

HIPAA

ISO 27001ISO27001

ISO 27001

AES-256

AES-256

SOC 2 Type II

SOC 2 Type II

[Try Transloadit for Free](/c/signup/)

[Try Transloadit for Free](/c/signup/)

No credit card needed · Cancel anytime
