We are a Swiss Army knife for your files

Transloadit is a service for companies with developers. We handle their file uploads and media processing. This means that they can save on development time and the heavy machinery that is required to handle big volumes in an automated way.

We pioneered with this concept in 2009 and have made our customers happy ever since. We are still actively improving our service in 2018, as well as our open source projects uppy.io and tus.io, which are changing how the world does file uploading.

×

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 across browsers in 2018 is lacking. Luckily there is dash.js, a JavaScript library that can add MPEG-DASH support to browsers that support Media Source Extensions. 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>
  <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 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>
Warning It seems your browser does not send the referer, which we need to stop people from (ab)using our demos in other websites. If you want to use the demos, please allow your browser to send its referer to us. Adding us to the whitelist of blockers usually helps.

1. Handle uploads

We can handle uploads of your users directly. Learn more ›

kite25.mp4
4.3 MB · 27s · 1024 × 768
':original': {
  robot: '/upload/handle',
}
/upload/handle Robot
This bot receives uploads that your users throw at you from browser or apps, or that you throw at us programatically

2. Resize videos to 1280×720 in WebM (VP9)

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 ›

kite25-0.webm
2.9 MB · 27s · 1280 × 720
plain_720_vp9_encoded: {
  use: [':original'],
  robot: '/video/encode',
  height: 720,
  preset: 'webm',
  width: 1280,
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

3. Resize videos to 1280×720 in iPad (high quality) (H.264)

kite25-0.mp4
4.3 MB · 27s · 1280 × 720
plain_720_h264_encoded: {
  use: [':original'],
  robot: '/video/encode',
  height: 720,
  preset: 'ipad-high',
  width: 1280,
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

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 ›

kite25-0.jpg
33 KB · 1280 × 720
thumbnailed: {
  use: ['plain_720_h264_encoded'],
  robot: '/video/thumbs',
  count: 1,
  format: 'jpg',
  height: 720,
  resize_strategy: 'fit',
  width: 1280,
}
/video/thumbs Robot
This bot extracts any number of images from videos for use as previews

5. Transcode videos to MPEG-Dash (720p) (H.264/H.265/VP9)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
dash-720p-video: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'dash-720p-video',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

6. Transcode videos to MPEG-Dash (360p) (H.264/H.265/VP9)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
dash-360p-video: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'dash-360p-video',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

7. Transcode videos to MPEG-Dash (270p) (H.264/H.265/VP9)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
dash-270p-video: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'dash-270p-video',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

8. Transcode videos to MPEG-Dash (32k) (H.264/H.265/VP9)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
dash-32k-audio: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'dash-32k-audio',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

9. Transcode videos to MPEG-Dash (64k) (H.264/H.265/VP9)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
dash-64k-audio: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'dash-64k-audio',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

10. Transcode videos to HLS (720p) (H.264)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
hls-720p-video: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'hls-720p',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

11. Transcode videos to HLS (360p) (H.264)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
hls-360p-video: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'hls-360p',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

12. Transcode videos to HLS (270p) (H.264)

This Step did not produce any files, or they were only meant to be consumed by another Robot below to produce the final result.
hls-270p-video: {
  use: [':original'],
  robot: '/video/encode',
  preset: 'hls-270p',
}
/video/encode Robot
This bot encodes, resizes, applies watermarks to videos and animated GIFs

13. Convert videos to MPEG-Dash

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 ›

480x270_85872_30_dashinit-0.mp4
300 KB · 27s · 480 × 270
32384_44100_dashinit-1.mp4
120 KB · 27s · 1280 × 720
1280x720_455448_30_dashinit-2.mp4
1.5 MB · 27s · 1280 × 720
640x360_139832_30_dashinit-3.mp4
482 KB · 27s · 640 × 360
64264_44100_dashinit-4.mp4
228 KB · 27s · 1280 × 720
dash-playlist-5.mpd
2.8 KB · 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',
  playlist_name: 'dash-playlist.mpd',
  technique: 'dash',
}
/video/adaptive Robot
This bot encodes videos into HTTP Live Streaming (HLS) and MPEG-Dash supported formats and generates the necessary manifest and playlist files

14. Convert videos to HLS

480x270_85192_30-1.m3u8
187 B · 10s · 480 × 270
640x360_99408_30-4.m3u8
187 B · 10s · 640 × 360
hls-playlist-5.m3u8
399 B · 10s · 640 × 360
1280x720_531544_30-7.m3u8
186 B · 9s · 1280 × 720

(not showing 1 additional file to keep demo previews compact)

hls-adapted: {
  use: {'steps':['hls-720p-video','hls-360p-video','hls-270p-video'],'bundle_steps':true},
  robot: '/video/adaptive',
  playlist_name: 'hls-playlist.m3u8',
  technique: 'hls',
}
/video/adaptive Robot
This bot encodes videos into HTTP Live Streaming (HLS) and MPEG-Dash supported formats and generates the necessary manifest and playlist files

15. Export files to Amazon S3

We export to the storage platform of your choice. Learn more ›

:original
plain_720_vp9_encoded
plain_720_h264_encoded
thumbnailed
dash-adapted
hls-adapted

Once files are exported, we ping you back with the Assembly status JSON.

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}',
}
/s3/store Robot
This bot exports encoding results to Amazon S3
Since this is a store robot, be sure to use Template Credentials so that any sensitive data is encrypted and stored in our database, making sure that they’re never exposed to any end-user.

16. Export files to Amazon S3

:original
plain_720_vp9_encoded
plain_720_h264_encoded
thumbnailed
dash-adapted
hls-adapted

Once files are exported, we ping you back with the Assembly status JSON.

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}',
}
/s3/store Robot
This bot exports encoding results to Amazon S3
Since this is a store robot, be sure to use Template Credentials so that any sensitive data is encrypted and stored in our database, making sure that they’re never exposed to any end-user.

Try it yourself

This live demo is powered by Uppy, our open source file uploader that you can also use without Transloadit, and tus, our open protocol for resumable file uploads that is making uploading more reliable across the world.

Full code used

{
  "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}"
    }
  }
}
// Add 'Transloadit' to your Podfile, run 'pod install', add credentials to 'Info.plist'
import Arcane
import TransloaditKit

// Add instructions, e.g. resize image, or encode video
var AssemblySteps: Array = Array<Step>() // An array to hold the Steps

var Step1 = Step (key: ":original") // Create a Step object
Step1?.setValue("/upload/handle", forOption: "robot") // Add the details
AssemblySteps.append(Step1) // Add the Step to the array

var Step2 = Step (key: "plain_720_vp9_encoded") // Create a Step object
Step2?.setValue([":original"], forOption: "use") // Add the details
Step2?.setValue("/video/encode", forOption: "robot") // Add the details
Step2?.setValue(true, forOption: "result") // Add the details
Step2?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step2?.setValue(720, forOption: "height") // Add the details
Step2?.setValue("webm", forOption: "preset") // Add the details
Step2?.setValue(1280, forOption: "width") // Add the details
AssemblySteps.append(Step2) // Add the Step to the array

var Step3 = Step (key: "plain_720_h264_encoded") // Create a Step object
Step3?.setValue([":original"], forOption: "use") // Add the details
Step3?.setValue("/video/encode", forOption: "robot") // Add the details
Step3?.setValue(true, forOption: "result") // Add the details
Step3?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step3?.setValue(720, forOption: "height") // Add the details
Step3?.setValue("ipad-high", forOption: "preset") // Add the details
Step3?.setValue(1280, forOption: "width") // Add the details
AssemblySteps.append(Step3) // Add the Step to the array

var Step4 = Step (key: "thumbnailed") // Create a Step object
Step4?.setValue(["plain_720_h264_encoded"], forOption: "use") // Add the details
Step4?.setValue("/video/thumbs", forOption: "robot") // Add the details
Step4?.setValue(true, forOption: "result") // Add the details
Step4?.setValue(1, forOption: "count") // Add the details
Step4?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step4?.setValue("jpg", forOption: "format") // Add the details
Step4?.setValue(720, forOption: "height") // Add the details
Step4?.setValue("fit", forOption: "resize_strategy") // Add the details
Step4?.setValue(1280, forOption: "width") // Add the details
AssemblySteps.append(Step4) // Add the Step to the array

var Step5 = Step (key: "dash-720p-video") // Create a Step object
Step5?.setValue([":original"], forOption: "use") // Add the details
Step5?.setValue("/video/encode", forOption: "robot") // Add the details
Step5?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step5?.setValue("dash-720p-video", forOption: "preset") // Add the details
AssemblySteps.append(Step5) // Add the Step to the array

var Step6 = Step (key: "dash-360p-video") // Create a Step object
Step6?.setValue([":original"], forOption: "use") // Add the details
Step6?.setValue("/video/encode", forOption: "robot") // Add the details
Step6?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step6?.setValue("dash-360p-video", forOption: "preset") // Add the details
AssemblySteps.append(Step6) // Add the Step to the array

var Step7 = Step (key: "dash-270p-video") // Create a Step object
Step7?.setValue([":original"], forOption: "use") // Add the details
Step7?.setValue("/video/encode", forOption: "robot") // Add the details
Step7?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step7?.setValue("dash-270p-video", forOption: "preset") // Add the details
AssemblySteps.append(Step7) // Add the Step to the array

var Step8 = Step (key: "dash-32k-audio") // Create a Step object
Step8?.setValue([":original"], forOption: "use") // Add the details
Step8?.setValue("/video/encode", forOption: "robot") // Add the details
Step8?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step8?.setValue("dash-32k-audio", forOption: "preset") // Add the details
AssemblySteps.append(Step8) // Add the Step to the array

var Step9 = Step (key: "dash-64k-audio") // Create a Step object
Step9?.setValue([":original"], forOption: "use") // Add the details
Step9?.setValue("/video/encode", forOption: "robot") // Add the details
Step9?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step9?.setValue("dash-64k-audio", forOption: "preset") // Add the details
AssemblySteps.append(Step9) // Add the Step to the array

var Step10 = Step (key: "hls-720p-video") // Create a Step object
Step10?.setValue([":original"], forOption: "use") // Add the details
Step10?.setValue("/video/encode", forOption: "robot") // Add the details
Step10?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step10?.setValue("hls-720p", forOption: "preset") // Add the details
AssemblySteps.append(Step10) // Add the Step to the array

var Step11 = Step (key: "hls-360p-video") // Create a Step object
Step11?.setValue([":original"], forOption: "use") // Add the details
Step11?.setValue("/video/encode", forOption: "robot") // Add the details
Step11?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step11?.setValue("hls-360p", forOption: "preset") // Add the details
AssemblySteps.append(Step11) // Add the Step to the array

var Step12 = Step (key: "hls-270p-video") // Create a Step object
Step12?.setValue([":original"], forOption: "use") // Add the details
Step12?.setValue("/video/encode", forOption: "robot") // Add the details
Step12?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step12?.setValue("hls-270p", forOption: "preset") // Add the details
AssemblySteps.append(Step12) // Add the Step to the array

var Step13 = Step (key: "dash-adapted") // Create a Step object
Step13?.setValue({"steps":["dash-720p-video","dash-360p-video","dash-270p-video","dash-64k-audio","dash-32k-audio"],"bundle_steps":true}, forOption: "use") // Add the details
Step13?.setValue("/video/adaptive", forOption: "robot") // Add the details
Step13?.setValue(true, forOption: "result") // Add the details
Step13?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step13?.setValue("dash-playlist.mpd", forOption: "playlist_name") // Add the details
Step13?.setValue("dash", forOption: "technique") // Add the details
AssemblySteps.append(Step13) // Add the Step to the array

var Step14 = Step (key: "hls-adapted") // Create a Step object
Step14?.setValue({"steps":["hls-720p-video","hls-360p-video","hls-270p-video"],"bundle_steps":true}, forOption: "use") // Add the details
Step14?.setValue("/video/adaptive", forOption: "robot") // Add the details
Step14?.setValue(true, forOption: "result") // Add the details
Step14?.setValue("v3.3.3", forOption: "ffmpeg_stack") // Add the details
Step14?.setValue("hls-playlist.m3u8", forOption: "playlist_name") // Add the details
Step14?.setValue("hls", forOption: "technique") // Add the details
AssemblySteps.append(Step14) // Add the Step to the array

var Step15 = Step (key: "adaptive_exported") // Create a Step object
Step15?.setValue(["dash-adapted","hls-adapted"], forOption: "use") // Add the details
Step15?.setValue("/s3/store", forOption: "robot") // Add the details
Step15?.setValue("demo_s3_credentials", forOption: "credentials") // Add the details
Step15?.setValue("${unique_original_prefix}-${file.original_basename}/adapt/${file.meta.relative_path}/${file.name}", forOption: "path") // Add the details
AssemblySteps.append(Step15) // Add the Step to the array

var Step16 = Step (key: "plain_exported") // Create a Step object
Step16?.setValue([":original","plain_720_vp9_encoded","plain_720_h264_encoded","thumbnailed"], forOption: "use") // Add the details
Step16?.setValue("/s3/store", forOption: "robot") // Add the details
Step16?.setValue("demo_s3_credentials", forOption: "credentials") // Add the details
Step16?.setValue("${unique_original_prefix}-${file.original_basename}/plain/${previous_step.name}.${file.ext}", forOption: "path") // Add the details
AssemblySteps.append(Step16) // Add the Step to the array

// We then create an Assembly Object with the Steps and files
var MyAssembly: Assembly = Assembly(steps: AssemblySteps, andNumberOfFiles: 1)

// Add files to upload
MyAssembly.addFile("./kite25.mp4") // Add the file)

// Start the Assembly
Transloadit.createAssembly(MyAssembly) 

// Fires after your Assembly has completed
transloadit.assemblyStatusBlock = {(_ completionDictionary: [AnyHashable: Any]) -> Void in
  print("\(completionDictionary.description)")
}
<body>
  <form action="/uploads" enctype="multipart/form-data" method="POST">
    <input type="file" name="my_file" multiple="multiple" />
  </form>

  <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
  <script src="//assets.transloadit.com/js/jquery.transloadit2-v3-latest.js"></script>
  <script type="text/javascript">
  $(function() {
    $('form').transloadit({
      wait: true,
      triggerUploadOnFileSelection: true,
      params: {
        auth: {
          // To avoid tampering use signatures:
          // https://transloadit.com/docs/api/#authentication
          key: 'YOUR_TRANSLOADIT_KEY',
        },
        // 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: '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}'
          }
        }
      }
    });
  });
  </script>
</body>
<link href="https://transloadit.edgly.net/releases/uppy/v0.27.3/dist/uppy.min.css" rel="stylesheet">
<script src="https://transloadit.edgly.net/releases/uppy/v0.27.3/dist/uppy.min.js"></script>

<button id="uppy-open-modal">Select Files</button>
<script>
  const uppy = Uppy.Core({ debug: true, autoProceed: false })
    .use(Uppy.Transloadit, {
      params: {
        auth: {
          // To avoid tampering use signatures:
          // https://transloadit.com/docs/api/#authentication
          key: 'YOUR_TRANSLOADIT_KEY'
        },
        // 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: '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}'
          }
        }
      },
      waitForEncoding: true
    })
    .use(Uppy.Dashboard, {
      trigger: '#uppy-open-modal',
      target: 'body'
    })
    .use(Uppy.Webcam, { target: Uppy.Dashboard })
    .use(Uppy.Instagram, {
      target: Uppy.Dashboard,
      serverUrl: 'https://api2.transloadit.com/companion',
      serverPattern: '.transloadit.com$'
    })
    .use(Uppy.Url, {
      target: Uppy.Dashboard,
      serverUrl: 'https://api2.transloadit.com/companion',
      serverPattern: '.transloadit.com$'
    })
    .on('transloadit:result', (stepName, result) => {
      // use transloadit encoding result here.
      console.log('Result here ====>', stepName, result)
    })
</script>
// npm install transloadit --save
const TransloaditClient = require('transloadit')

const transloadit = new TransloaditClient({
  authKey: 'YOUR_TRANSLOADIT_KEY',
  authSecret: 'YOUR_TRANSLOADIT_SECRET'
})

transloadit.addFile('myfile_1', './kite25.mp4')

const options = {
  params: {
    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}',
      },
    }
  }
}

transloadit.createAssembly(options, (err, result) => {
  if (err) {
    throw err
  }

  console.log({result})
})
npm install transloadify -g

export TRANSLOADIT_KEY="YOUR_TRANSLOADIT_KEY"
export TRANSLOADIT_SECRET="YOUR_TRANSLOADIT_SECRET"

echo '{
  ":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}"
  }
}' > ./steps.json

transloadify \
  --input ./lolcat.jpg \
  --output ./resized-lolcat.jpg \
  --steps ./steps.json
// Install "transloadit/php-sdk"
// via Composer (https://getcomposer.org)
use transloadit\Transloadit;
$transloadit = new Transloadit([
  "key" => "YOUR_TRANSLOADIT_KEY",
  "secret" => "YOUR_TRANSLOADIT_SECRET",
]);

$files = [];
array_push($files, "./kite25.mp4");

$response = $transloadit->createAssembly([
  "files" => $files, 
  "params" => [
    "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" => [
          "" => null,
        ],
      ],
      "plain_exported" => [
        "use" => [":original", "plain_720_vp9_encoded", "plain_720_h264_encoded", "thumbnailed"],
        "robot" => "/s3/store",
        "credentials" => "demo_s3_credentials",
        "path" => [
          "" => null,
        ],
      ],
    ],
  ],
]);
# gem install transloadit
transloadit = Transloadit.new(
  :key => "YOUR_TRANSLOADIT_KEY",
  :secret => "YOUR_TRANSLOADIT_SECRET"
)

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

assembly = transloadit.assembly(
  :steps => [ :original, plain_720_vp9_encoded, plain_720_h264_encoded, thumbnailed, dash-720p-video, dash-360p-video, dash-270p-video, dash-32k-audio, dash-64k-audio, hls-720p-video, hls-360p-video, hls-270p-video, dash-adapted, hls-adapted, adaptive_exported, plain_exported ]
)

# Add files to upload
files = []
files.push("./kite25.mp4")

# Start the Assembly
response = assembly.create! *files

until response.finished?
  sleep 1; response.reload!
end

if !response.error?
  # handle success
end
# pip install pytransloadit
from transloadit import client

tl = client.Transloadit('YOUR_TRANSLOADIT_KEY', 'YOUR_TRANSLOADIT_SECRET')
assembly = tl.new_assembly()

# Add instructions, e.g. resize image, or encode video
assembly.add_step(':original', {
  'robot': '/upload/handle'
})
assembly.add_step('plain_720_vp9_encoded', {
  'use': [':original'],
  'robot': '/video/encode',
  'result': true,
  'ffmpeg_stack': 'v3.3.3',
  'height': 720,
  'preset': 'webm',
  'width': 1280
})
assembly.add_step('plain_720_h264_encoded', {
  'use': [':original'],
  'robot': '/video/encode',
  'result': true,
  'ffmpeg_stack': 'v3.3.3',
  'height': 720,
  'preset': 'ipad-high',
  'width': 1280
})
assembly.add_step('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
})
assembly.add_step('dash-720p-video', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'dash-720p-video'
})
assembly.add_step('dash-360p-video', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'dash-360p-video'
})
assembly.add_step('dash-270p-video', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'dash-270p-video'
})
assembly.add_step('dash-32k-audio', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'dash-32k-audio'
})
assembly.add_step('dash-64k-audio', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'dash-64k-audio'
})
assembly.add_step('hls-720p-video', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'hls-720p'
})
assembly.add_step('hls-360p-video', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'hls-360p'
})
assembly.add_step('hls-270p-video', {
  'use': [':original'],
  'robot': '/video/encode',
  'ffmpeg_stack': 'v3.3.3',
  'preset': 'hls-270p'
})
assembly.add_step('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'
})
assembly.add_step('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'
})
assembly.add_step('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}'
})
assembly.add_step('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}'
})

# Add files to upload
assembly.add_file(open('./kite25.mp4', 'rb'))

# Start the Assembly
assembly_response = assembly.create(retries=5, wait=True)

print assembly_response.data.get('assembly_id')

# or
print assembly_response.data['assembly_id']
// go get gopkg.in/transloadit/go-sdk.v1
options := transloadit.DefaultConfig
options.AuthKey = "YOUR_TRANSLOADIT_KEY"
options.AuthSecret = "YOUR_TRANSLOADIT_SECRET"
client := transloadit.NewClient(options)

// Initialize new assembly
assembly := transloadit.NewAssembly()

// Add instructions, e.g. resize image, or encode video
assembly.AddStep(":original", map[string]interface{}{
  "robot": "/upload/handle"
})
assembly.AddStep("plain_720_vp9_encoded", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v3.3.3",
  "height": 720,
  "preset": "webm",
  "width": 1280
})
assembly.AddStep("plain_720_h264_encoded", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v3.3.3",
  "height": 720,
  "preset": "ipad-high",
  "width": 1280
})
assembly.AddStep("thumbnailed", map[string]interface{}{
  "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
})
assembly.AddStep("dash-720p-video", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "dash-720p-video"
})
assembly.AddStep("dash-360p-video", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "dash-360p-video"
})
assembly.AddStep("dash-270p-video", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "dash-270p-video"
})
assembly.AddStep("dash-32k-audio", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "dash-32k-audio"
})
assembly.AddStep("dash-64k-audio", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "dash-64k-audio"
})
assembly.AddStep("hls-720p-video", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "hls-720p"
})
assembly.AddStep("hls-360p-video", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "hls-360p"
})
assembly.AddStep("hls-270p-video", map[string]interface{}{
  "use": [":original"],
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "hls-270p"
})
assembly.AddStep("dash-adapted", map[string]interface{}{
  "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"
})
assembly.AddStep("hls-adapted", map[string]interface{}{
  "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"
})
assembly.AddStep("adaptive_exported", map[string]interface{}{
  "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}"
})
assembly.AddStep("plain_exported", map[string]interface{}{
  "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}"
})

// Add files to upload
assembly.AddFile("myfile_1", "./kite25.mp4")

// Start the Assembly
info, err := client.StartAssembly(context.Background(), assembly)
if err != nil {
  panic(err)
}

// All files have now been uploaded and the Assembly has started but no
// results are available yet since the conversion has not finished.
// WaitForAssembly provides functionality for polling until the Assembly
// has ended.
info, err = client.WaitForAssembly(context.Background(), info)
if err != nil {
  panic(err)
}

fmt.Printf("You can view the result at: %s\n", info.Results["resize"][0].SSLURL)
// compile 'com.transloadit.sdk:transloadit:0.0.3'
import com.transloadit.sdk.Assembly;
import com.transloadit.sdk.Transloadit;
import com.transloadit.sdk.exceptions.LocalOperationException;
import com.transloadit.sdk.exceptions.RequestException;
import com.transloadit.sdk.response.AssemblyResponse;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

public class Main {
    public static void main(String[] args) {
        Transloadit transloadit = new Transloadit("YOUR_TRANSLOADIT_KEY", "YOUR_TRANSLOADIT_SECRET");
        Assembly assembly = transloadit.newAssembly();
        // Add instructions, e.g. resize image, or encode video
        Map<String Object> originalStepOptions = new HashMap();
        
        assembly.addStep(":original", "/upload/handle", originalStepOptions);
      
        Map<String Object> plain720Vp9EncodedStepOptions = new HashMap();
        plain720Vp9EncodedStepOptions.put("use", new String[]{":original"});
        plain720Vp9EncodedStepOptions.put("result", true);
        plain720Vp9EncodedStepOptions.put("ffmpeg_stack", "v3.3.3");
        plain720Vp9EncodedStepOptions.put("height", 720);
        plain720Vp9EncodedStepOptions.put("preset", "webm");
        plain720Vp9EncodedStepOptions.put("width", 1280);
        assembly.addStep("plain_720_vp9_encoded", "/video/encode", plain720Vp9EncodedStepOptions);
      
        Map<String Object> plain720H264EncodedStepOptions = new HashMap();
        plain720H264EncodedStepOptions.put("use", new String[]{":original"});
        plain720H264EncodedStepOptions.put("result", true);
        plain720H264EncodedStepOptions.put("ffmpeg_stack", "v3.3.3");
        plain720H264EncodedStepOptions.put("height", 720);
        plain720H264EncodedStepOptions.put("preset", "ipad-high");
        plain720H264EncodedStepOptions.put("width", 1280);
        assembly.addStep("plain_720_h264_encoded", "/video/encode", plain720H264EncodedStepOptions);
      
        Map<String Object> thumbnailedStepOptions = new HashMap();
        thumbnailedStepOptions.put("use", new String[]{"plain_720_h264_encoded"});
        thumbnailedStepOptions.put("result", true);
        thumbnailedStepOptions.put("count", 1);
        thumbnailedStepOptions.put("ffmpeg_stack", "v3.3.3");
        thumbnailedStepOptions.put("format", "jpg");
        thumbnailedStepOptions.put("height", 720);
        thumbnailedStepOptions.put("resize_strategy", "fit");
        thumbnailedStepOptions.put("width", 1280);
        assembly.addStep("thumbnailed", "/video/thumbs", thumbnailedStepOptions);
      
        Map<String Object> dash-720p-videoStepOptions = new HashMap();
        dash-720p-videoStepOptions.put("use", new String[]{":original"});
        dash-720p-videoStepOptions.put("ffmpeg_stack", "v3.3.3");
        dash-720p-videoStepOptions.put("preset", "dash-720p-video");
        assembly.addStep("dash-720p-video", "/video/encode", dash-720p-videoStepOptions);
      
        Map<String Object> dash-360p-videoStepOptions = new HashMap();
        dash-360p-videoStepOptions.put("use", new String[]{":original"});
        dash-360p-videoStepOptions.put("ffmpeg_stack", "v3.3.3");
        dash-360p-videoStepOptions.put("preset", "dash-360p-video");
        assembly.addStep("dash-360p-video", "/video/encode", dash-360p-videoStepOptions);
      
        Map<String Object> dash-270p-videoStepOptions = new HashMap();
        dash-270p-videoStepOptions.put("use", new String[]{":original"});
        dash-270p-videoStepOptions.put("ffmpeg_stack", "v3.3.3");
        dash-270p-videoStepOptions.put("preset", "dash-270p-video");
        assembly.addStep("dash-270p-video", "/video/encode", dash-270p-videoStepOptions);
      
        Map<String Object> dash-32k-audioStepOptions = new HashMap();
        dash-32k-audioStepOptions.put("use", new String[]{":original"});
        dash-32k-audioStepOptions.put("ffmpeg_stack", "v3.3.3");
        dash-32k-audioStepOptions.put("preset", "dash-32k-audio");
        assembly.addStep("dash-32k-audio", "/video/encode", dash-32k-audioStepOptions);
      
        Map<String Object> dash-64k-audioStepOptions = new HashMap();
        dash-64k-audioStepOptions.put("use", new String[]{":original"});
        dash-64k-audioStepOptions.put("ffmpeg_stack", "v3.3.3");
        dash-64k-audioStepOptions.put("preset", "dash-64k-audio");
        assembly.addStep("dash-64k-audio", "/video/encode", dash-64k-audioStepOptions);
      
        Map<String Object> hls-720p-videoStepOptions = new HashMap();
        hls-720p-videoStepOptions.put("use", new String[]{":original"});
        hls-720p-videoStepOptions.put("ffmpeg_stack", "v3.3.3");
        hls-720p-videoStepOptions.put("preset", "hls-720p");
        assembly.addStep("hls-720p-video", "/video/encode", hls-720p-videoStepOptions);
      
        Map<String Object> hls-360p-videoStepOptions = new HashMap();
        hls-360p-videoStepOptions.put("use", new String[]{":original"});
        hls-360p-videoStepOptions.put("ffmpeg_stack", "v3.3.3");
        hls-360p-videoStepOptions.put("preset", "hls-360p");
        assembly.addStep("hls-360p-video", "/video/encode", hls-360p-videoStepOptions);
      
        Map<String Object> hls-270p-videoStepOptions = new HashMap();
        hls-270p-videoStepOptions.put("use", new String[]{":original"});
        hls-270p-videoStepOptions.put("ffmpeg_stack", "v3.3.3");
        hls-270p-videoStepOptions.put("preset", "hls-270p");
        assembly.addStep("hls-270p-video", "/video/encode", hls-270p-videoStepOptions);
      
        Map<String Object> dash-adaptedStepOptions = new HashMap();
        dash-adaptedStepOptions.put("use", new HashMap(){{
            put("steps", new String[]{"dash-720p-video", "dash-360p-video", "dash-270p-video", "dash-64k-audio", "dash-32k-audio"});
            put("bundle_steps", true);
        }});
        dash-adaptedStepOptions.put("result", true);
        dash-adaptedStepOptions.put("ffmpeg_stack", "v3.3.3");
        dash-adaptedStepOptions.put("playlist_name", "dash-playlist.mpd");
        dash-adaptedStepOptions.put("technique", "dash");
        assembly.addStep("dash-adapted", "/video/adaptive", dash-adaptedStepOptions);
      
        Map<String Object> hls-adaptedStepOptions = new HashMap();
        hls-adaptedStepOptions.put("use", new HashMap(){{
            put("steps", new String[]{"hls-720p-video", "hls-360p-video", "hls-270p-video"});
            put("bundle_steps", true);
        }});
        hls-adaptedStepOptions.put("result", true);
        hls-adaptedStepOptions.put("ffmpeg_stack", "v3.3.3");
        hls-adaptedStepOptions.put("playlist_name", "hls-playlist.m3u8");
        hls-adaptedStepOptions.put("technique", "hls");
        assembly.addStep("hls-adapted", "/video/adaptive", hls-adaptedStepOptions);
      
        Map<String Object> adaptiveExportedStepOptions = new HashMap();
        adaptiveExportedStepOptions.put("use", new String[]{"dash-adapted", "hls-adapted"});
        adaptiveExportedStepOptions.put("credentials", "demo_s3_credentials");
        adaptiveExportedStepOptions.put("path", "${unique_original_prefix}-${file.original_basename}/adapt/${file.meta.relative_path}/${file.name}");
        assembly.addStep("adaptive_exported", "/s3/store", adaptiveExportedStepOptions);
      
        Map<String Object> plainExportedStepOptions = new HashMap();
        plainExportedStepOptions.put("use", new String[]{":original", "plain_720_vp9_encoded", "plain_720_h264_encoded", "thumbnailed"});
        plainExportedStepOptions.put("credentials", "demo_s3_credentials");
        plainExportedStepOptions.put("path", "${unique_original_prefix}-${file.original_basename}/plain/${previous_step.name}.${file.ext}");
        assembly.addStep("plain_exported", "/s3/store", plainExportedStepOptions);
      
        // Add files to upload
        assembly.addFile(new File("./kite25.mp4"));
        
        try {
            AssemblyResponse response = assembly.save();

            // wait for assembly to finish executing.
            while (!response.isFinished()) {
                response = transloadit.getAssemblyByUrl(response.getSslUrl());
            }

            System.out.println(response.getId());
            System.out.println(response.getUrl());
            System.out.println(response.json());
        } catch (RequestException | LocalOperationException e) {
            // handle exception here
        }
    }
}

So many ways to integrate

Transloadit is a service for companies with developers. As a developer, there are many ways you can put us to good use.
  • Bulk imports

    Add one of our import Robots to acquire and transcode massive media libraries.
  • Handling uploads

    We are the experts at reliably handling uploads. We wrote the protocol for it.
  • Front-end integration

    We integrate with web browsers via our next-gen file uploader Uppy and SDKs for Android and iOS.
  • Back-end integration

    Send us batch jobs in any server language using one of our SDKs or directly interfacing with our REST API.
  • Pingbacks

    Configure a notify_url to let your server receive transcoding results JSON in the transloadit POST field.

Try it in your account

Copy these instructions to a Template of your own
(you'll be able to make changes before actually saving)

Get started for free

  • Free plan with 2 GB encoding credit
  • Set monthly spending limits
  • Try without a credit card
  • Highly available, globally distributed platform
  • Cancel at any time
  • Costs displayed for each upload/conversion

Need help? Talk to a human