Skip to documentation
Deploy on AWS
Menu
Documentation · 17 of 19

Docs/Video outputs

Convert the input file to any formats

Every outputs must be set inside the outputs key with each value being a Hash describing the output format and settings.

The format specs are named following a very simple naming convention described in the Formats page.

Examples

Transcoding to webm, 2 mp4 formats and 1 mp3 audio only format:

{
  "outputs": {
    "webm": {
      "path": "/webm/video.webm"
    },
    "mp4:360p": {
      "path": "/mp4/360p/video.mp4"
    },
    "mp4:720p": {
      "path": "/mp4/720p/video.mp4"
    },
    "mp3:64k": {
      "path": "/mp3/audio.mp3"
    }
  }
}

Parameters

NameTypeDefaultRequired
path<br>The path including the filename where the file will be uploaded. See Storage.stringYes
key<br>Will rename the output key which is sent in the notification payload. Very useful because you can change the output settings but the key name you get at the end will be unchanged. No code to update on your side.stringNo
format<br>Set the format specs. This is totally optional since you can set all the format specs inside the output key by following the syntax described here.hashNo
resolution<br>Set the resolution.<br>Example: 1280x720, 1280x or any resolution 144p 240p 360p 480p 540p 576p 720p 1080p 1440p 2160p 4k.stringOriginalNo
video_codec<br>Set the video codec.<br>copy dnxhd h264 hevc novideo prores prores-ks vp8 vp9. Container compatibility is enforced; see Certified Transcoding Profiles.stringNo
video_bitrate<br>Set the video bitrate. 30k and 220000k<br>Example: 2000k.stringNo
fps<br>Set the FPS.<br>0fps (preserve source FPS), 15fps 23.98fps 25fps 29.97fps 30fps 60fps.stringOriginalNo
audio_codec<br>Set the audio codec.<br>aac ac3 copy mp2 mp3 noaudio pcm pcm-alaw pcm-s16le pcm-u8 vorbis. Container compatibility is enforced.stringNo
audio_bitrate<br>Set the audio bitrate.<br>Between 8k and 512k.<br>Example: 96k.stringNo
sample_rate<br>Set the audio sample rate.<br>8000hz 11025hz 22050hz 44100hz 48000hz.stringNo
channels<br>Set the audio channel.<br>mono stereo.stringNo
quality<br>Set the visual quality.<br>Between 1 (worst) to 5 (visually lossless).intNo
pix_fmt<br>Set the pixel format.<br>yuv420p yuv422p yuv420p10le yuv444p10le.stringNo
vprofile<br>Set the video profile.<br>H264 only: baseline main high high10 high422 high444.stringNo
level<br>Set the certified H264 level.<br>10 11 12 13 20 21 22 30 31 32 40 41 42 50 51.intNo
metadata<br>Strip the metadata included in the original media file if 0.<br>0 1.int1No

Encoding Options

NameTypeDefaultRequired
deinterlace<br>Will deinterlace the video if enabledboolfalseNo

Rotation

NameTypeDefaultRequired
transpose<br>Rotate the video<br>0 90CounterCLockwise and Vertical Flip (default)<br>1 90Clockwise<br>2 90CounterClockwise<br>3 90Clockwise and Vertical Flip<br>We automatically use transpose for videos taken in portrait mode.int0No
vflip<br>Vertically Flip the video<br>We automatically use vflip for videos taken upsidedown.boolfalseNo
hflip<br>Horizontally Flip the video<br>We automatically use hflip for videos taken upsidedown.boolfalseNo

Cut

NameTypeDefaultRequired
duration<br>Max duration in *second* of the video. if 10, the encoded video length will be 10 seconds.intNo
offset<br>Will start the encoding at the given offset in *second*.intNo

Watermark

NameTypeDefaultRequired
watermark<br>Overlay an image (PNG) over the video.hashNo
url<br>URL of the png image that will be incrusted in the video. Transparent and semi-transparent images are compatible.URLNo
position<br>Position of the watermark.<br>topleft topright bottomleft bottomright center (since API 2023-002)stringtopleftNo

Example:

{
  "outputs": {
    "mp4:480p::quality=3": {
      "key": "mp4:480p:wm",
      "path": "/mp4/480p/video_wm.mp4",
      "watermark": {
        "url": "https://yourserver/watermark.png",
        "position": "bottomright"
      }
    }
  }
}