API documentation

Coconut's API is a config-based API built with simplicity and flexibility in mind.
Encode your first video in less than 5 minutes.

API Reference

HTTP Live Streaming

Keyword: outputs must be prefixed by the keyword -> followed by the format ID.

Format ID: hls

The first value is the output URL which is the master playlist in m3u8. Every playlists and segment files will be uploaded to the same directory.

Convert the source video to HTTP Live Streaming.

For example:

-> hls = s3://accesskey:secretkey@bucket/hls/video.m3u8

Parameters

NameTypeDefaultRequired
if
If the given condition is false, the output won't be processed.
Logical operators we support are: < > <= >= <> != = AND OR NOT..
string No
variants
A list of Simple Formats separated by commas
The formats specs must have mpegts as container, h264 as video codec and aac / mp3 as audio codec
format ID[,] aac:64k_22050hz, hls:240p_300k, hls:360p_600k, hls:360p_1000k, hls:480p_1500k, hls:720p No
segment_duration
The duration in second of each video chunks. Min 4, Max 60. Recommended value is 10 (default)
int 10 No

Closed Captioning

NameTypeDefaultRequired
caption_urls
Caption URLs separate by comma.
Input caption format must be srt or webvtt
URL[,] No
caption_languages
Caption languages separated by comma.
The language of the caption in ISO 639-1 (2 chars). Eg. en es fr
Required if caption_urls
string[,] Yes | No
caption_names
Caption names separated by comma.
The description of the caption written in the language
Required if caption_urls
string[,] Yes | No
caption_options
Caption options separated by comma.
The options DEFAULT AUTOSELECT and FORCED for each captions written into the master playlist.
The value must contain 3 numbers 0 for NO and 1 for YES.
For instance you want the caption to have default and autoselect options: 110
int[,] 000 No

Watermark

NameTypeDefaultRequired
watermark_url
URL of the png image that will be incrusted in the video. Transparent and semi-transparent images are compatible.
URL No
watermark_position
Position of the watermark.
topleft topright bottomleft bottomright
string topleft No