Transloadit

  • Demos
  • Docs & Help
  • Press
  • Pricing & Signup
hello@transloadit.comCall usBlogLogin

/video/encode robot

Takes a single video file and converts it to a given format.

Optional parameters

Name Type Default Description
realtime boolean false Allows to encode a video while it is still uploading! If the uploaded video is not streamable, the robot automatically falls back to normal encoding after the upload.
preset string "" Converts a video using pre-configured settings. Click here for a list of presets.
width 1 - 1920 Width of the input video Size for the new video in px..
height 1 - 1080 Height of the input video Height for the new video in px.
resize_strategy string "pad" Click here for a list of available resize strategies.
rotate integer (auto) Force the video to be rotated by the given integer of degrees. Currently only multiples of 90 are supported. Note: We automatically correct the orientation for many videos if the camera provides that information. This option is only useful for videos you need to rotate because the camera did not record the rotation.
ffmpeg object {} An object with parameters to pass to FFmpeg. Check the FFmpeg documentation for available options. If you are using a preset, the options given here will be merged on top.
The ffmpeg r parameter (framerate) has a default value of 25 and a maximum value of 60.
hint boolean false Enables hinting for mp4 files for RTP/RTSP streaming.

Watermark parameters

Name Type Default Description
watermark_url string "" Url to a png image to overlay over this image.
watermark_position string/array "center" The position you'd like the watermark to have. Available options are: "center", "top", "bottom", "left", "right". You can also combine options, for example "bottom-right".
You can also specify an array of possible values out of which one value will be picked randomly. E.g. ["center","left","bottom-left","bottom-right"]

Note that this will push the watermark into the respective corner. If you want a specific pixel-offset on the watermark you need to include this in the form of padding into the image itself.
watermark_size string "" The size in percent for this watermark. E.g. "50%".
watermark_resize_strategy string "fit" Supports "fit" and "stretch".

Presets

Getting encoding options right can be very difficult. To make your life easier, Transloadit offers presets that are optimized for various devices & platforms.

We'll expose some main characteristics like codecs & bitrates used. More specific encoding options we use, are available at request.

PresetVideo codecVideo formatVideo resVideo bitrateAudio codecAudio bitrateAudio sampling frequency
android-highlibx264mp4480x320700klibfaac128k48k
android-lowlibx264mp4480x32096klibfaac64k48k
androidlibx264mp4480x320512klibfaac128k48k
flashflvflv320x240512klibmp3lame64k44100
ipad-highlibx264mp41024x7681200klibfaac128k48k
ipad-lowlibx264mp41024x768512klibfaac128k48k
ipadlibx264mp41024x768700klibfaac128k48k
iphone-highlibx264mp4480x320700klibfaac128k48k
iphone-lowlibx264mp4480x32096klibfaac64k48k
iphonelibx264mp4480x320512klibfaac128k48k
mp3mp3libmp3lame12800044100
webmlibvpxwebm700klibvorbis128k48k
wmvwmv2asfwmav2

You can use our presets as templates, and override specific options if needed. In this example we adjust the iPhone preset for iPhone4 usage, which has a bigger screen (width, height), and we'll also set a higher video bitrate because of that (b).

{
  "steps": {
    "iphone4": {
      "robot": "/video/encode",
      "preset": "iphone",
      "width": 960,
      "height": 640,
      "ffmpeg": {
        "b": "1200K"
      }
    }
  }
}

Demos

  • Encode a video for the iphone
  • Encode a video for android
  • Encode a video into flash
  • Encode a video into webm
  • Encode a video into flash and mov
  • Encode a video into 640x480 pixels using the pad strategy
  • Apply a watermark onto a video
  • Encode a video changing its bitrate to 2000k
  • Encode a video in realtime
  • Surround a video with a frame

Comments

Help

  • Start a new support ticket
  • Browse existing support tickets

Integration

  • Transloadit Basics
  • The minimal integration
  • Building assembly instructions
  • Notifications vs Redirect Url
  • Templates
  • Configuring the jQuery plugin
  • How to add multi-file upload
  • Saving and displaying your files
  • Development Kits
  • NodeJS SDK
  • PHP SDK
  • Ruby Gem
  • iPhone SDK
  • Python SDK

API Documentation

  • API Basics
  • Authentication
  • The response
  • Robots
  • /image/resize
  • /video/encode
  • /video/thumbs
  • /audio/encode
  • /http/import
  • /file/filter
  • Storage Robots
  • /s3/store
  • /sftp/store
  • /cloudfiles/store
  • /youtube/store

More

  • How to set up an Amazon S3 bucket
  • Supported formats & codecs
  • FAQ
  • Community projects
  • About
  • Blog
  • Follow us on Facebook
  • Follow us on Twitter
  • Email
  • Imprint
  • Privacy policy
  • Terms of service