Tasks
Introduction
Tasks let you do powerful things with your media files in just a few lines of code.
The input to a task is any publicly-accessible (or signed) URL pointing to a media file.
Tasks create new output files such as transcoded video, resized images, extracted audio, subtitles, and more.
How tasks work
Tasks take a url as input, plus a kind to specify what type of processing to perform.
That's all that's needed for some tasks. For example, to transcribe a video:
For tasks that support additional configuration, options are passed under the options key:
Task object
When a task is created, it returns a 201 Created response containing the task object.
Task statuses
Tasks progress through the following statuses:
| Status | Description |
|---|---|
waiting | Task has been created and is waiting to be processed |
validating | Input is being validated |
queued | Task is queued for processing |
processing | Task is actively being processed |
finishing | Processing is complete, outputs are being finalized |
succeeded | Task completed successfully |
failed | Task failed — check the error field for details |
cancelled | Task was cancelled |
Task progress
Tasks are processed asynchronously. You can poll the task endpoint for updates:
A completed task will have status: "succeeded" and populated outputs:
In production apps with many tasks, use Webhooks to get notified when a task completes instead of polling.
Required fields
All tasks require:
url— a publicly accessible or signed URL pointing to the input filekind— the type of task to create
Task options
Different task kinds have different options that control the output. Options are passed under the options key.
For example, the video task has width, height, format, quality, and other options:
The speech task has no options — all analysis is returned by default:
See the individual task kind docs below for all available options.
Task kinds
Media
Media tasks create new media files from your input.
Video
Image
Audio
Adaptive Video
Tracks
Track tasks create supplementary data files for your media.
Subtitles
Chapters
Thumbnails
Intelligence
Intelligence tasks analyze your media and extract structured data.