# Combine

## Overview

The Video combining service offers a seamless solution for merging two video files into a single cohesive video. It intelligently combines the videos while considering resolution and frame rate to maintain the best possible quality. The result file starts with the first input video and continues with the second one. As always, multiple input formats are supported.

Resolution considerations are handled gracefully when merging videos. By adopting the lower resolution of the two input videos, we prevent upscaling and maintain the original quality of the lower resolution video, ensuring optimal visual integrity in the final combined clip.

The frame rate of the result video is determined by adopting the highest frame rate from the two inputs. This ensures that the final combined clip maintains the smoothness and consistency of motion.

## Typical use cases

Merging input videos can be useful in multiple use cases:

* **Video compilations** - Multiple video clips can be effortlessly compiled into a single montage, useful for creating highlights and compilations for various purposes such as marketing, promotions or social media content.
* **Advertisement creation** - Different video segments can be combined into a single cohesive advertisement, ensuring a seamless viewing experience, effective storytelling or brand messaging.
* **Workflow streamlining** - Combining videos into a single file simplifies the video management workflow. It allows for easier organization, sharing, and distribution of video content, reducing the need for handling multiple video files separately.
* **Viewing experience enhancement** - Merging two videos into one can provide uninterrupted viewing experience by eliminating the need for viewers to manually switch between separate video files.

## 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/#7d078d1c-7411-4e29-9ede-bd7719391072>" %}

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 videos

{% embed url="<https://www.pexels.com/download/video/16343098>" %}

{% embed url="<https://www.pexels.com/download/video/2231485>" %}

### Request body

```json
[
    {
        "url": "https://www.pexels.com/download/video/16343098",
        "url_2": "https://www.pexels.com/download/video/2231485"
        
    }
]
```

### API response

```json
{
    "status": "ok",
    "version": 2.11,
    "result": [
        {
            "uuid": "fb9c2fba-dc84-4c43-93f7-ee8915d2ee5d",
            "url": "https://www.pexels.com/download/video/16343098",
            "url_2": "https://www.pexels.com/download/video/2231485",
            "sha1": "dfec29eb2d9d5234e4ed5b70cebd4da00f721d26",
            "sha1_2": "298da7e2e2e6e01764d6aec9802608efce2b49e7",
            "combined": "https://fbmjmuoeb.filerobot.com/https://filerobot.s3.eu-west-3.amazonaws.com/fbmjmuoeb/combined_videos/QFtsC/16343098_2231485_combined.mp4",
            "progress": "https://api.filerobot.com/fbmjmuoeb/v4/video-status/ZXUtb3YtNzA2LWdyYTIuZWxhc3RpYy11cGxvYWRlci5haXJzdG9yZS5zY2FsM2ZsM3guY29tOjg3MzI__fb9c2fba-dc84-4c43-93f7-ee8915d2ee5d"
        }
    ]
}
```

### Output video

{% embed url="<https://filerobot.s3.eu-west-3.amazonaws.com/fbmjmuoeb/combined_videos/QFtsC/16343098_2231485_combined.mp4>" %}


---

# 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/editing/combine.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.
