# Compress

## Overview

The Video compression service provides a way to modify input videos by changing their bitrate and resolution. With support for multiple input formats and the flexibility to specify target resolution and bitrate using either concrete numeric values or predefined strings for typical uses, customers can optimize their video content for various devices and use cases.

A wide range of input video formats are supported, enabling video compression regardless of the original format and ensuring utilization across different platforms, devices, and playback environments.

The ability to specify target resolution and bitrate in several ways offers great flexibility. Videos can be easily adapted for different devices, screen sizes and network conditions, optimizing the viewing experience for their audience.

By converting videos to target resolutions and bitrates suitable for specific types of devices (e.g., mobile, tablet, desktop), the service ensures optimal playback performance and user experience. The delivered videos are tailored to the capabilities and display characteristics of different devices.

## Typical use cases

Video compression can be used in the following use cases:

* **Multi-device content delivery** - If video content is distributed across different platforms and devices, the videos can be adapted to the specific resolutions and bitrates required, ensuring the content is optimally displayed and performs well regardless of the specific platform.
* **Video advertisements** - Video ads can be converted and optimized for various advertising channels and ad placements, such as mobile ads, in-app ads, desktop ads, etc.
* **Responsive web design** - Videos can be adjusted to match the breakpoints in a responsive design, which guarantees that they are appropriately displayed and offers a consistent user experience across different screen sizes.

## API endpoints

Information about the specific API endpoints is available in an always up-to-date documentation, that can be accessed via the following link:

{% embed url="<https://developers.scaleflex.com/#f1ffa622-3020-494b-b7b2-7c8895bfdf22>" %}

There, you can find detailed information about the API endpoints, together with all required request parameters, so you know how to interact with them.

## Examples

### Input video

{% embed url="<https://www.pexels.com/download/video/2231485/?fps=23.976&h=720&w=1280>" %}

### Request body

```json
[
    {
        "url":"https://www.pexels.com/download/video/2231485/?fps=23.976&h=720&w=1280", 
        "video_resolutions":["200", "400", "600", "mobile"]
    }
]
```

### API response

```json
{
    "status": "ok",
    "version": 2.11,
    "result": [
        {
            "uuid": "e3abd370-a587-4048-92c6-1f4a168ff374",
            "url": "https://www.pexels.com/download/video/2231485/?fps=23.976&h=720&w=1280",
            "compressed": [
                "https://fbmjmuoeb.filerobot.com/https://filerobot.s3.eu-west-3.amazonaws.com/fbmjmuoeb/compressed_videos/hnlCJ_/_200p_500k_compressed.mp4",
                "https://fbmjmuoeb.filerobot.com/https://filerobot.s3.eu-west-3.amazonaws.com/fbmjmuoeb/compressed_videos/hnlCJ_/_400p_500k_compressed.mp4",
                "https://fbmjmuoeb.filerobot.com/https://filerobot.s3.eu-west-3.amazonaws.com/fbmjmuoeb/compressed_videos/hnlCJ_/_600p_500k_compressed.mp4",
                "https://fbmjmuoeb.filerobot.com/https://filerobot.s3.eu-west-3.amazonaws.com/fbmjmuoeb/compressed_videos/hnlCJ_/_360p_500k_compressed.mp4"
            ],
            "sha1": "91aaadd5f7c0f5dc279ab33bc3df4f031b5d1e9c",
            "progress": "https://api.filerobot.com/fbmjmuoeb/v4/video-status/ZXUtb3YtNzA2LWdyYTIuZWxhc3RpYy11cGxvYWRlci5haXJzdG9yZS5zY2FsM2ZsM3guY29tOjg3MzI__e3abd370-a587-4048-92c6-1f4a168ff374"
        }
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scaleflex.com/dynamic-media-optimization-dmo/transformations/video-optimization/video-api/optimizing/compress.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
