# Video Resizer & Cropper – 9:16, 1:1, 16:9 for Reels, Shorts (`gazidev/video-resizer`) Actor

Video resizer & cropper for social media: reframe video URLs to 9:16 (Reels, Shorts, TikTok), 1:1, 4:5 or 16:9 with blurred background, crop or color bars. Many formats per video, 1080p MP4, trim to 60/90 s, public links. $0.06 per output minute (1080p).

- **URL**: https://apify.com/gazidev/video-resizer.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $60.00 / 1,000 full hd video minutes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Resizer & Cropper – 9:16, 1:1, 16:9 for Reels, Shorts

Resize and crop videos for every social format in one run. Paste direct links to your video files, pick the aspect ratios you need, and get back **ready-to-upload MP4 files** with public download links:

- **9:16 vertical** for Instagram Reels, YouTube Shorts, TikTok, Stories (1080×1920)
- **1:1 square** and **4:5 portrait** for Instagram / Facebook / LinkedIn feeds (1080×1080, 1080×1350)
- **16:9 landscape** for YouTube, websites and presentations (1920×1080)
- plus 4:3, 3:4, 2:3, 21:9 or **any custom ratio** like `5:4`

Three ways to change the aspect ratio:

| Mode | What it does | Best for |
|---|---|---|
| `pad-blur` (default) | Keeps the whole picture and fills the empty area with a **blurred, zoomed copy** of the video | Landscape clips turned into Reels/Shorts without cutting anything off |
| `crop` | **Crops to fill** the frame; choose center, top, bottom, left or right | Talking heads, product shots, centered action |
| `pad-color` | Adds **letterbox / pillarbox bars** in any color (`black`, `white`, `#1a1a1a`) | Clean branded look, presentations |

One source can produce several formats at once (e.g. 9:16 + 1:1 + 4:5): the video is downloaded once and every format is a separate MP4. Trim with `startTime` and `maxOutputSeconds` (60 s for Shorts, 90 s for Reels) and pay only for the output length.

Inputs: MP4, MOV, WebM, MKV, AVI, M4V and **HLS `.m3u8`** – anything FFmpeg reads. Phone videos with rotation metadata are handled correctly.

> **Not a YouTube / TikTok / Instagram downloader.** Links to pages of YouTube, TikTok, Instagram, Facebook, X, Vimeo and similar platforms are refused with a clear error (free). Use direct links to files you own or are allowed to process: your CDN, S3 / R2 / GCS bucket, Dropbox direct links, stock footage, form uploads.

### What can I use it for?

- **Repurpose landscape videos into Reels, Shorts and TikToks** – webinar clips, podcast videos, product demos, ads.
- **Make every ad size from one master** – 9:16, 1:1, 4:5 and 16:9 versions in a single run.
- **Bulk-reformat a content library** (CSV or a dataset from another Actor) for a new channel.
- **Fix vertical phone videos for YouTube / websites** – 16:9 with a blurred background instead of black bars.
- **Automations:** call it from Make, Zapier, n8n or your backend whenever a new video lands in a bucket.

### Input

| Field | Description |
|---|---|
| `videoUrls`, `bulkText`, `datasetId` | Direct video file links (list, pasted text/CSV, or another Apify dataset) |
| `aspectRatios` | `["9:16"]` by default; any of `9:16`, `1:1`, `4:5`, `16:9`, `4:3`, `3:4`, `2:3`, `21:9`, custom `W:H`, or words `vertical`, `square`, `portrait`, `landscape` |
| `mode` | `pad-blur` (default), `crop`, `pad-color` |
| `cropFocus` | `center` (default), `top`, `bottom`, `left`, `right` |
| `padColor`, `blurStrength` | Bar color for `pad-color`; blur radius for `pad-blur` (40 default) |
| `resolution` | Short side of the output: `1080` (default → 1080×1920 for 9:16), `720`, `480`, `360`, `1440`, `2160` |
| `allowUpscale` | Off by default: the output short side never exceeds the source short side (a 720p video becomes 720×1280) |
| `startTime`, `maxOutputSeconds` | Skip the beginning; cut the output to N seconds (0 = whole video) |
| `quality`, `fps`, `mute` | CRF 30 / 26 / 22, frame rate (0 = keep), remove audio |
| `maxFileSizeMb`, `maxDurationMinutes` | Safety limits: 500 MB and 30 minutes per video (skipped videos are free) |

Turn a landscape video into a 60-second Reel and a square post:

```json
{
  "videoUrls": ["https://download.samplelib.com/mp4/sample-10s.mp4"],
  "aspectRatios": ["9:16", "1:1"],
  "mode": "pad-blur",
  "resolution": "1080",
  "maxOutputSeconds": 60
}
```

Crop a talking-head video to vertical, keeping the left side of the frame:

```json
{
  "videoUrls": ["https://example.com/videos/interview.mp4"],
  "aspectRatios": ["9:16"],
  "mode": "crop",
  "cropFocus": "left"
}
```

### Output

One dataset row per output video (Output tab: **Resized videos** table with download links). The file is in the run's key-value store; `fileUrl` is a public link.

```json
{
  "sourceUrl": "https://download.samplelib.com/mp4/sample-10s.mp4",
  "aspectRatio": "9:16",
  "mode": "pad-blur",
  "status": "ok",
  "input": {"duration": 10.216, "width": 1920, "height": 1080, "aspectRatio": 1.7778, "fps": 29.97,
            "videoCodec": "h264", "audioCodec": "aac", "sizeBytes": 5485935},
  "output": {"width": 1080, "height": 1920, "duration": 10.216, "fps": 29.97, "videoCodec": "h264",
             "audioCodec": "aac", "bitrateKbps": 3272, "sizeBytes": 4179613, "format": "mp4"},
  "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/000-sample-10s-9x16.mp4",
  "fileKey": "000-sample-10s-9x16.mp4",
  "billedEvents": {"fullhd-video-minute": 1},
  "processingSec": 3.3,
  "processedAt": "2026-10-14T09:12:40+00:00"
}
```

In `crop` mode the row also has `cropWindow` (`width`, `height`, `x`, `y` of the kept area in source pixels).
Failed items have `status: "error"`, an `errorCode` (`UNSUPPORTED_PLATFORM`, `INVALID_URL`, `HTTP_404`, `NOT_MEDIA`, `NO_VIDEO_STREAM`, `FILE_TOO_LARGE`, `TOO_LONG`, `TRIM_OUT_OF_RANGE`, `MAX_CHARGE_REACHED`, …) and a readable `error` – and are **never charged**. A `SUMMARY` record has run totals.

### Pricing

Pay per started minute of **output** video, by output resolution. Every aspect ratio is its own output. Failed, skipped and refused videos are free.

| Output | Price per minute |
|---|---|
| SD (short side ≤ 576 px, e.g. 480×854) | $0.02 |
| HD (720×1280, 720×720 …) | $0.035 |
| Full HD (1080×1920, 1080×1080, 1080×1350, 1920×1080) | $0.06 |
| 4K / 1440p | $0.25 |
| Actor start | $0.00005 |

Examples: a 30-second clip → 9:16 at 1080×1920 = **$0.06**; the same clip as 9:16 + 1:1 + 4:5 = **$0.18**; at 720p = **$0.105** for all three. A 3-minute video cut to a 60-second Short = **$0.06**. Set a maximum total charge on the run and the Actor stops cleanly before exceeding it.

Related Actors on the Apify Store (30-day users at the time of writing):

| Actor | Users (30 d) | Price model |
|---|---|---|
| whitewalk/ffmpeg-cloud-mcp (general FFmpeg tool) | 29 | $0.03–0.04 per operation |
| agentutilitylabs/short-video-assembler | 9 | $0.20 per video |
| adorable/video-optimizer | 1 | – |

A 60-second Reel costs $0.06 in Full HD or $0.035 in HD. A general FFmpeg tool can do the same if you write the filter yourself; this Actor is built for the social-format job: presets, blurred background, several formats per run, crop position, trimming to platform limits, clean table output.

### FAQ

**Which size is best for Reels, Shorts and TikTok?** 9:16 at 1080×1920 (the default). For feed posts use 4:5 (1080×1350) on Instagram/Facebook or 1:1.

**Will my video be cut off?** Not in `pad-blur` or `pad-color` mode – the whole picture stays visible. `crop` fills the frame and removes the overflow; pick `cropFocus` to keep the important side.

**Does it upscale small videos?** Not by default: a 720p source gives 720×1280 (billed as HD). Turn on `allowUpscale` to force the chosen resolution.

**Can I resize a YouTube or TikTok video?** No. Platform pages are refused on purpose (their terms forbid downloading). Use a direct link to a file you own or may process.

**How long can videos be?** Up to `maxDurationMinutes` (30 default, max 600) and `maxFileSizeMb` (500 MB default). For files over ~1 GB run with 8 GB+ memory.

**What format is the output?** MP4, H.264 (x264 superfast, CRF 22/26/30) + AAC with fast start – accepted by Instagram, TikTok, YouTube, Facebook, LinkedIn and X.

**How long are files kept?** In the run's default key-value store, subject to your Apify data retention. Download or copy them if you need them longer.

### Use with AI agents / Apify MCP

The Actor works as a tool in the [Apify MCP server](https://mcp.apify.com) (Claude, Cursor, VS Code, ChatGPT and other MCP clients) and through the Apify API. An agent can say *"make a 9:16 Reel and a square version of this video"* or *"crop this clip to vertical, first 60 seconds"* and get back public `fileUrl`s. Typical chain: video URL → this Actor → your scheduler / social posting tool.

```bash
curl -X POST "https://api.apify.com/v2/acts/gazidev~video-resizer/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls":["https://download.samplelib.com/mp4/sample-10s.mp4"],"aspectRatios":["9:16","1:1"],"mode":"pad-blur"}'
```

# Actor input Schema

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

Direct links to video FILES: MP4, MOV, WebM, MKV, AVI or HLS `.m3u8` (your CDN, S3/R2/GCS bucket, Dropbox direct link…). Pages of YouTube, TikTok, Instagram, Vimeo etc. are refused: this is a resizer, not a downloader.

## `bulkText` (type: `string`):

One URL per line or a CSV with a `url` column.

## `datasetId` (type: `string`):

Chain after another Actor that outputs video file URLs.

## `datasetField` (type: `string`):

Field name in that dataset.

## `aspectRatios` (type: `array`):

One output per ratio per video. Presets: `9:16` (Reels, Shorts, TikTok, Stories), `1:1` (square feed), `4:5` (Instagram/Facebook portrait feed), `16:9` (YouTube, landscape), `4:3`, `3:4`, `2:3`, `21:9` - or any custom `W:H`. Words like `vertical`, `square`, `portrait`, `landscape` work too.

## `mode` (type: `string`):

`pad-blur` keeps the whole picture and fills the empty area with a blurred, zoomed copy (the typical Reels/Shorts look). `crop` fills the frame and cuts the overflow. `pad-color` adds bars in `padColor`.

## `cropFocus` (type: `string`):

Only for `crop`: which part of the picture to keep.

## `padColor` (type: `string`):

Only for `pad-color`: a color name (`black`, `white`, `gray`…) or hex like `#1a1a1a`.

## `blurStrength` (type: `integer`):

Only for `pad-blur`: blur radius in pixels of the output (40 = soft, 100 = very blurry).

## `resolution` (type: `string`):

Size of the SHORT side of the output: 1080 gives 1080×1920 (9:16), 1080×1080 (1:1), 1080×1350 (4:5), 1920×1080 (16:9). Small sources are not upscaled unless `allowUpscale` is on. Billing depends on the output resolution.

## `allowUpscale` (type: `boolean`):

Off: the output's short side is never larger than the source's short side (a 720p video becomes 720×1280 for 9:16 even if 1080 is chosen, and is billed as HD). On: always output exactly the chosen resolution.

## `startTime` (type: `string`):

Optional: skip the beginning, seconds (`12.5`) or `MM:SS` / `HH:MM:SS`.

## `maxOutputSeconds` (type: `integer`):

0 = whole video. E.g. 60 for YouTube Shorts, 90 for Reels, 180 for TikTok. You pay only for the output length.

## `quality` (type: `string`):

MP4 H.264 + AAC with fast start, plays on every platform.

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

0 = keep the source frame rate.

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

Drop the audio track.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped with an error row (not charged).

## `maxDurationMinutes` (type: `integer`):

Cost cap: longer videos are skipped (not charged) - set `maxOutputSeconds` or raise the limit.

## `maxConcurrency` (type: `integer`):

Encoding is CPU-bound; more than 2 only helps with more memory (CPU).

## `proxyConfiguration` (type: `object`):

Only for hosts that block datacenter IPs (HTTP 403).

## Actor input object example

```json
{
  "videoUrls": [
    "https://download.samplelib.com/mp4/sample-10s.mp4"
  ],
  "datasetField": "url",
  "aspectRatios": [
    "9:16"
  ],
  "mode": "pad-blur",
  "cropFocus": "center",
  "padColor": "black",
  "blurStrength": 40,
  "resolution": "1080",
  "allowUpscale": false,
  "maxOutputSeconds": 0,
  "quality": "balanced",
  "fps": 0,
  "mute": false,
  "maxFileSizeMb": 500,
  "maxDurationMinutes": 30,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `all` (type: `string`):

No description

## `files` (type: `string`):

No description

## `summary` (type: `string`):

No description

# 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://download.samplelib.com/mp4/sample-10s.mp4"
    ],
    "aspectRatios": [
        "9:16"
    ],
    "mode": "pad-blur",
    "resolution": "1080"
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/video-resizer").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://download.samplelib.com/mp4/sample-10s.mp4"],
    "aspectRatios": ["9:16"],
    "mode": "pad-blur",
    "resolution": "1080",
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/video-resizer").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://download.samplelib.com/mp4/sample-10s.mp4"
  ],
  "aspectRatios": [
    "9:16"
  ],
  "mode": "pad-blur",
  "resolution": "1080"
}' |
apify call gazidev/video-resizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/video-resizer"
        }
    }
}
```

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/7CGfbuupXYCzVevKb/builds/bfCc2TJ2wTr20mWVy/openapi.json
