# Video Editor API: Crop, Rotate, Speed, Mute & Reverse (`data-done-right/video-editor-ops`) Actor

Edit videos from direct file URLs in one call: crop (9:16, 1:1 or exact box), rotate, flip, speed up or slow down, mute, reverse and set fps. H.264 mp4 out with a signed link. No YouTube. Billed per clip (30 s included), free on failure.

- **URL**: https://apify.com/data-done-right/video-editor-ops.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** Videos, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 clip editeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Video Editor API: Crop, Rotate, Speed, Mute & Reverse

This **video editor API** crops, rotates, flips, speeds up or slows down, mutes and reverses videos from direct file URLs, and sets the frame rate, **all in one batch call**. Pick the operations once, list as many videos as you like, and every video comes back as an **H.264 mp4** with a download link. Several operations on one video are applied in a single pass, so you pay once. It runs ffmpeg in the cloud: nothing to install and no API key.

> **What it does not do.** It reads **direct video files** (mp4, mov, webm, mkv, avi) from a public URL; it **does not download from YouTube, Vimeo, TikTok, Instagram or other streaming sites** and rejects those links without charge. HLS/DASH playlists (.m3u8, .mpd) are not supported. It **only outputs H.264/AAC mp4**: no WebM, GIF, H.265 or AV1. It **does not cut or trim by time, merge, add audio or music, add text or logos, burn subtitles, stabilise, colour-correct or resize to a preset** (use the related tools below). It is not a timeline editor: operations are a fixed set applied in a fixed order. Rotation is in quarter turns only (no free angle). **Reverse is limited to 60 seconds and about 1.5 GB of raw frames**, because ffmpeg holds every frame in memory. Speed is 0.25x to 4x. Sources above Full HD are limited to 3 minutes, and frames larger than 4K are rejected. It follows the robots.txt of the host that serves your files. Use it only on videos you own or have the right to edit.

**What you get**

- One dataset row per video: the operations applied, source and result size in pixels and bytes, source and result length, the billed units, a signed download link, and a status or a clear error.
- Operations applied in a fixed order: **crop, rotate, flip, reverse, speed, frame rate**. Crop comes first so that reverse has fewer pixels to hold.
- Per-video options: give each video its own crop, speed or mute through the `videos` list.
- Bad inputs never stop the run, say exactly what is wrong and are free.

### Operations

| Option | Values | What it does |
|---|---|---|
| `cropAspect` | `1:1`, `9:16`, `16:9`, `4:5` or any `W:H` | Centre-crops to the largest frame of that ratio. |
| `cropWidth`, `cropHeight`, `cropX`, `cropY` | pixels | Exact crop box. A missing width or height runs to the frame edge; a missing X or Y centres the box. |
| `rotate` | `0`, `90`, `180`, `270` | Clockwise quarter turns. 90 and 270 swap width and height. |
| `flip` | `none`, `horizontal`, `vertical`, `both` | Mirrors the picture. |
| `speed` | 0.25 to 4 | 2 = twice as fast, 0.5 = slow motion. Audio follows with its pitch kept. |
| `reverse` | true / false | Plays backwards, audio included. Up to 60 s. |
| `mute` | true / false | Removes the audio track. Mute alone on an H.264 file is a lossless stream copy. |
| `fps` | 1 to 120 | Converts to this constant frame rate. |

Crop coordinates are in the picture **as you see it**: a phone video stored sideways with a rotation tag is measured after that tag is applied. Crop sizes are rounded down to even numbers (an H.264 requirement). A crop that does not fit inside the frame is rejected for that video, with the frame size in the message, and costs nothing. You must set at least one operation; a plain re-encode is the job of Video Compressor.

### How to crop a video to 9:16 or 1:1

Set `cropAspect` to `9:16` for a vertical Reels/Shorts/TikTok frame, `1:1` for a square post or `4:5` for a feed portrait. The Actor takes the largest centred box of that ratio, so a 1920x1080 source becomes 606x1080 at `9:16` and 1080x1080 at `1:1`. For a different part of the picture use `cropX` and `cropY` with `cropWidth` and `cropHeight`.

### How to rotate or flip a video

`rotate: "90"` turns the video clockwise (a sideways phone clip becomes upright) and `flip: "horizontal"` mirrors it. Both can be combined with a crop in the same call.

### How to speed up, slow down or reverse a video

`speed: 2` doubles the speed and halves the length; `speed: 0.5` makes slow motion by repeating frames (it does not invent new ones). Audio is time-stretched with its pitch kept. `reverse: true` plays the clip backwards and reverses the audio too. If a video is longer than 60 s, cut the part you want first with **Cut Video: Video Trimmer, Clip Cutter & Video to GIF**.

### How to mute a video or change its frame rate

`mute: true` drops the audio track (and is a fast, lossless stream copy when the video is H.264 and nothing else is requested). `fps: 24` or `fps: 30` converts to a constant frame rate, which is useful before further processing.

### Input

| Field | Default | What it does |
|---|---|---|
| `videoUrls` | sample video | Direct video file links (required unless you use `videos`). |
| `videos` | empty | Per-video settings: `[{"url", "name", "speed", "cropAspect", ...}]`. Options left out come from the run-level settings. |
| operations | none | `cropAspect`, `cropWidth`, `cropHeight`, `cropX`, `cropY`, `rotate`, `flip`, `speed`, `reverse`, `mute`, `fps` (see above). At least one is needed. |
| `crf` | 23 | Quality when re-encoding, 16 (best) to 35 (smallest). |
| `maxDurationMinutes` | 10 | Source duration cap (above Full HD: 3 min). Billing is per 30 s, so this also caps your cost. |
| `maxVideoSizeMb` | 500 | Source size cap (max 2048). |
| `maxVideosPerRun` | 50 | Hard cap on videos per run (max 1000). |
| `videoTimeoutSecs` | 1800 | Per download and per edit. |
| `outputStoreName` | empty | Save the files in a named store that is kept until you delete them. |

Input example:

```json
{
  "videoUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"],
  "cropAspect": "1:1",
  "speed": 2
}
```

### Output

One row per video, from a real local run of the input above:

```json
{
  "sourceUrl": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
  "videoIndex": 1,
  "name": null,
  "operations": {"cropAspect": "1:1", "speed": 2.0},
  "mode": "encode",
  "sourceBytes": 1128375,
  "bytes": 145549,
  "sourceWidth": 960,
  "sourceHeight": 540,
  "width": 540,
  "height": 540,
  "sourceDurationSeconds": 5.055,
  "durationSeconds": 2.569,
  "billedClips": 1,
  "billedExtra30s": 0,
  "url": "https://api.apify.com/v2/key-value-stores/<store>/records/v01-edited.mp4",
  "key": "v01-edited.mp4",
  "status": "ok",
  "error": null,
  "note": "Audio was sped up or slowed down with its pitch kept (atempo)."
}
```

A failure row has `status: "error"` and an `error` naming the problem. `status: "skipped"` means a free skip: the spending limit was reached or `maxVideosPerRun` was hit. On Apify the `url` is a signed link that downloads without a token.

### Use with the Apify API, MCP, n8n and Make

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("data-done-right/video-editor-ops").call(run_input={
    "videoUrls": ["https://example.com/demo.mp4"], "cropAspect": "9:16", "mute": True})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["status"], row["url"] or row["error"])
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('data-done-right/video-editor-ops').call({
  videoUrls: ['https://example.com/demo.mp4'], rotate: '90', flip: 'horizontal' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

In n8n or Make use the Apify node with the actor name and the same JSON. With Apify's MCP server (mcp.apify.com) an AI assistant can call it: "crop this video to vertical and mute it". It needs only a video URL.

### Use cases

- Turn landscape footage into vertical 9:16 or square 1:1 versions for Reels, Shorts and feed posts.
- Fix sideways phone video with a rotation, or mirror a selfie clip.
- Make time-lapse (`speed: 4`) and slow-motion (`speed: 0.5`) versions of clips.
- Strip the sound from product demos and background loops with `mute`.
- Normalise a batch of clips to one frame rate before further processing.
- Make reversed clips for transitions and loops.

### How much does it cost

Pay per event: **$0.025 per edited video, which covers its first 30 seconds of source video, plus $0.02 for each further started 30 seconds.** The length counted is the source video, so speed and reverse do not change the price.

| Source length | Price |
|---|---|
| up to 30 s | $0.025 |
| 31 to 60 s | $0.045 |
| 5 minutes | $0.205 |
| 10 minutes | $0.405 |

Failed videos, skipped videos, rejected links and the `SUMMARY` record are free, and any number of operations on a video cost the same. Plan discounts apply (Silver about 10%, Gold and higher about 20%). Apify platform usage is included. `maxVideosPerRun` and `maxDurationMinutes` cap a run, and if you set a maximum spend per run the Actor stops cleanly when it is reached and removes the file it could not charge for.

### FAQ

#### Can I apply several operations at once?

Yes, all of them in one pass and for one price: for example crop to 9:16, mute and speed up 1.5x. The order is fixed: crop, rotate, flip, reverse, speed, frame rate.

#### Is the result re-encoded?

Yes, except when mute is the only operation and the source is H.264, which is a lossless copy of the video stream. Otherwise the video is re-encoded to H.264 with `crf` 23 by default and 128 kbps AAC audio. Metadata such as GPS tags and chapters are removed, and only the first audio track is kept.

#### Why was my reverse rejected?

Reverse needs every frame in memory. It is limited to 60 s and about 1.5 GB of raw frames, so a 720p 30 fps clip can be about 35 s, a 1080p clip about 15 s, and cropping first makes room. The message gives the numbers. Cut the clip shorter first with the video trimmer.

#### Does speed change the pitch of the sound?

No. Audio is time-stretched with ffmpeg's atempo filter so the voice keeps its pitch. Very fast or very slow speeds can sound processed.

#### Which limits apply?

Source files up to 2 GB (default 500 MB) and 10 minutes by default (set `maxDurationMinutes` up to any value; above Full HD the limit is 3 minutes and frames larger than 4K are rejected), up to 1,000 videos per run. Links to private or internal addresses are blocked, and the hosts of your files must allow automated fetching in their robots.txt. The whole source file is downloaded once per video.

#### How long are the files kept?

They live in the run's key-value store, which expires with your plan's retention period. Set `outputStoreName` to keep them in a named store until you delete them.

### Related tools

- **Cut Video: Video Trimmer, Clip Cutter & Video to GIF** cuts clips by time and makes GIFs.
- **Video Compressor & Resizer: Shrink MP4 for Web, Social & AI** shrinks files to a preset size or a target size in MB.
- **Video Frame Extractor: Keyframes, Scenes & Thumbnails for AI** pulls still images from the same videos.
- **Merge Videos: Concatenate, Join & Combine Video Clips** joins clips into one file.

# Actor input Schema

## `videoUrls` (type: `array`):

Direct links to video files (mp4, mov, webm, mkv, avi). Example: https://example.com/clip.mp4. Every video gets the operations set below. YouTube, Vimeo, TikTok and other streaming-site page links are rejected, with no charge.

## `videos` (type: `array`):

Different operations per video: \[{"url": "https://example.com/a.mp4", "name": "intro", "speed": 2, "cropAspect": "9:16"}, ...]. Any option below can be set per video; options left out come from the run-level settings. Used in addition to 'Video URLs'.

## `cropAspect` (type: `string`):

Centre-crop to the largest frame of this ratio: 1:1 (square), 9:16 (vertical), 16:9, 4:5 or any W:H. Example: 9:16. Leave empty for no ratio crop. Use either this or the exact crop box below.

## `cropWidth` (type: `integer`):

Exact crop box, width in pixels of the picture as you see it (after any rotation tag). If you give only one of width and height, the other runs to the edge of the frame. Example: 640.

## `cropHeight` (type: `integer`):

Exact crop box, height in pixels. Example: 360.

## `cropX` (type: `integer`):

Distance of the crop box from the left edge. Leave empty to centre it horizontally. Example: 0.

## `cropY` (type: `integer`):

Distance of the crop box from the top edge. Leave empty to centre it vertically. Example: 0.

## `rotate` (type: `string`):

Quarter turns only. 90 and 270 swap width and height. Applied after the crop.

## `flip` (type: `string`):

Mirror the picture. Horizontal swaps left and right, vertical turns it upside down.

## `speed` (type: `number`):

2 = twice as fast (half the length), 0.5 = slow motion (twice as long). Audio is changed with its pitch kept. Range 0.25 to 4. 1 = unchanged.

## `reverse` (type: `boolean`):

Play the video backwards, audio included. Limited to 60 seconds and about 1.5 GB of raw frames (a 720p 30 fps clip up to roughly 35 s); crop or cut longer videos first. Applied after crop, rotate and flip.

## `mute` (type: `boolean`):

Drop the audio track. On H.264 files, mute alone is a fast stream copy with no quality loss.

## `fps` (type: `integer`):

Convert to this constant frame rate, for example 24 or 30. Leave empty to keep the source rate. Applied last, so it is the real output rate.

## `crf` (type: `integer`):

H.264 quality when the video is re-encoded: lower = better and bigger files. 18 is near-lossless, 23 is the default, 28 is small.

## `maxDurationMinutes` (type: `number`):

Longer source videos are rejected without charge. Billing is per started 30 seconds, so this also caps your cost. Example: 10.

## `maxVideosPerRun` (type: `integer`):

Hard cap on videos edited in one run. Videos past the cap are listed as skipped.

## `maxVideoSizeMb` (type: `integer`):

Source files above this size are rejected before the download finishes.

## `videoTimeoutSecs` (type: `integer`):

Applies separately to the download and to the edit of each video.

## `outputStoreName` (type: `string`):

Optional key-value store name. Named stores are kept until you delete them, while a run's own store expires after your plan's retention period. Example: my-edited-videos.

## Actor input object example

```json
{
  "videoUrls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  ],
  "cropAspect": "1:1",
  "rotate": "0",
  "flip": "none",
  "speed": 2,
  "reverse": false,
  "mute": false,
  "crf": 23,
  "maxDurationMinutes": 10,
  "maxVideosPerRun": 50,
  "maxVideoSizeMb": 500,
  "videoTimeoutSecs": 1800
}
```

# Actor output Schema

## `results` (type: `string`):

One row per video with its download link, operations, sizes, billed units and status, as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the edited mp4 files and the run summary.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
    ],
    "cropAspect": "1:1",
    "speed": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/video-editor-ops").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "videoUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"],
    "cropAspect": "1:1",
    "speed": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/video-editor-ops").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  ],
  "cropAspect": "1:1",
  "speed": 2
}' |
apify call data-done-right/video-editor-ops --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/video-editor-ops"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/HOZzXmIOnpzIC2W3J/builds/QzPFzkG9pId1LsTF0/openapi.json
