Video
The Compressor Video API delivers high-efficiency video compression and transcoding for modern streaming, web, and application workflows. By combining advanced codecs with intelligent bitrate modeling and format-aware optimizations, Compressor consistently produces smaller video files with excellent visual quality — often achieving dramatic size reductions without sacrificing playback reliability.
Whether you're optimizing videos for the web, mobile delivery, or storage at scale, the Video API provides predictable output, modern codec support, and flexible resizing options in a single, unified interface.
Typical Use Cases
- Web and mobile video optimization
- Preparing videos for streaming platforms
- Reducing bandwidth and storage costs
- Generating responsive video assets
- Automating transcoding pipelines
Video Compression API
All video processing supports the standard compression parameter, which controls how aggressively the video is optimized. Compression settings are passed under the video namespace:
{
"video": {
"compression": "high"
}
}Compression Modes
medium- balanced compression suitable for most use cases. Preserves visual quality while reducing file size.high(default) - more aggressive compression optimized for web delivery, streaming, and bandwidth-sensitive environments.ultra- maximum compression for the smallest possible output size. Best suited for previews, background videos, or constrained networks.
The default compression mode is high. Higher compression levels typically result in smaller files. Compressor uses advanced bitrate calculations, content-aware encoding strategies, and modern codec tuning to achieve optimal results for each video.
Supported Input Formats
The Video API accepts all major container formats, including: MP4, WebM, MOV, AVI, MKV, WMV, FLV, OGV, M4V, 3GP.
Input format detection is automatic.
Output Formats & Codecs
Compressed videos can be output in the following container formats: mp4 and webm.
Codec Selection
You may explicitly select the codec used within the output container.
MP4
h264av1
WebM
vp8vp9
Example:
{
"video": {
"output": {
"format": "webm",
"codec": "vp9"
}
}
}If no codec is specified, Compressor automatically selects the most appropriate codec based on the output format, compression level, and source characteristics.
Video Resizing API
The Video API provides flexible resizing and scaling capabilities designed for responsive playback, streaming delivery, previews, and standardized video pipelines. Resizing operations are codec-aware and preserve visual quality while applying the selected compression level, ensuring optimal results across modern playback environments.
All resizing options are configured under the video.resize namespace.
{
"video": {
"resize": {
"mode": "fit",
"width": 1280,
"height": 720
}
}
}Resize Modes
Compressor supports four resize modes to accommodate different layout and design requirements.
auto
Auto mode is the default resizing approach. It automatically resizes the image while preserving its aspect ratio. At least one of width or height must be provided.
- If only
widthis specified, theheightis calculated automatically. - If only
heightis specified, thewidthis calculated automatically. - If both are specified, the image is scaled proportionally to fit within the bounding box.
This mode is ideal for most responsive use cases.
fill
In this mode, both width and height attributes are required. It resizes the image so that it fits within the requested dimensions while preserving its aspect ratio. If the source image does not perfectly match the target aspect ratio, empty space may remain around the image. This space is filled according to the selected background behavior.
By default, this space is filled with a transparent background for formats that support transparency (PNG, WebP, AVIF), or white for formats that do not (such as JPEG).
Background Handling
When empty space is present, the following background options are available:
autoFills the background using the dominant color extracted from the image, producing a natural, visually consistent result.
blurFills the background using a blurred version of the original image, ideal for banners, previews, and mixed-aspect-ratio layouts.
- Hex color
Fills the background with a custom color specified as a hexadecimal RGB or RGBA value, for example
#ff3b00.
Use fill mode when you need predictable output dimensions without cropping, while retaining full control over how any remaining space around the image is handled.