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
| Name | Type | Default | Required |
|---|
| path<br>The path including the filename where the file will be uploaded. See Storage. | string | | Yes |
| 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. | string | | No |
| 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. | hash | | No |
↳ resolution<br>Set the resolution.<br>Example: 1280x720, 1280x or any resolution 144p 240p 360p 480p 540p 576p 720p 1080p 1440p 2160p 4k. | string | Original | No |
↳ 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. | string | | No |
↳ video_bitrate<br>Set the video bitrate. 30k and 220000k<br>Example: 2000k. | string | | No |
↳ fps<br>Set the FPS.<br>0fps (preserve source FPS), 15fps 23.98fps 25fps 29.97fps 30fps 60fps. | string | Original | No |
↳ 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. | string | | No |
↳ audio_bitrate<br>Set the audio bitrate.<br>Between 8k and 512k.<br>Example: 96k. | string | | No |
↳ sample_rate<br>Set the audio sample rate.<br>8000hz 11025hz 22050hz 44100hz 48000hz. | string | | No |
↳ channels<br>Set the audio channel.<br>mono stereo. | string | | No |
↳ quality<br>Set the visual quality.<br>Between 1 (worst) to 5 (visually lossless). | int | | No |
↳ pix_fmt<br>Set the pixel format.<br>yuv420p yuv422p yuv420p10le yuv444p10le. | string | | No |
↳ vprofile<br>Set the video profile.<br>H264 only: baseline main high high10 high422 high444. | string | | No |
↳ level<br>Set the certified H264 level.<br>10 11 12 13 20 21 22 30 31 32 40 41 42 50 51. | int | | No |
↳ metadata<br>Strip the metadata included in the original media file if 0.<br>0 1. | int | 1 | No |
Encoding Options
| Name | Type | Default | Required |
|---|
| deinterlace<br>Will deinterlace the video if enabled | bool | false | No |
Rotation
| Name | Type | Default | Required |
|---|
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. | int | 0 | No |
| vflip<br>Vertically Flip the video<br>We automatically use vflip for videos taken upsidedown. | bool | false | No |
| hflip<br>Horizontally Flip the video<br>We automatically use hflip for videos taken upsidedown. | bool | false | No |
Cut
| Name | Type | Default | Required |
|---|
duration<br>Max duration in *second* of the video. if 10, the encoded video length will be 10 seconds. | int | | No |
| offset<br>Will start the encoding at the given offset in *second*. | int | | No |
Watermark
| Name | Type | Default | Required |
|---|
| watermark<br>Overlay an image (PNG) over the video. | hash | | No |
| ↳ url<br>URL of the png image that will be incrusted in the video. Transparent and semi-transparent images are compatible. | URL | | No |
↳ position<br>Position of the watermark.<br>topleft topright bottomleft bottomright center (since API 2023-002) | string | topleft | No |
Example:
{
"outputs": {
"mp4:480p::quality=3": {
"key": "mp4:480p:wm",
"path": "/mp4/480p/video_wm.mp4",
"watermark": {
"url": "https://yourserver/watermark.png",
"position": "bottomright"
}
}
}
}