Merging 42 seconds of 1080p on ReelSDK cost about two thirds of a cent re-encoded, and under a tenth of a cent with the concat demuxer and -c copy. One POST /v1/ffmpeg call joins up to 50 video URLs at $0.02 per compute minute.

Merge videos API

Yes: list the clips in order and send ReelSDK a filter graph that scales, pads and lines them up in a 1920x1080 frame at 30 fps, even when their sizes differ.

Use casesUpdated

merged.mp4: walkout.mp4 (12 s) then launch.mp4 (30 s), joined into one 42-second 1080p video.Input: walkout.mp4merged.mp4 (26.3 MB)merged-copy.mp4 (32.0 MB)

The request

POST /v1/ffmpeg

Join clips into one MP4 by URL with the concat filter or demuxer, up to 50 inputs, for well under a cent a merge.

terminalTry it
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
  -H "Authorization: Bearer $REELSDK_KEY" \
  --json '{
    "inputs": {
      "walkout.mp4": "https://api.reelsdk.com/f/lib/in/use-cases/walkout.mp4",
      "launch.mp4": "https://api.reelsdk.com/f/lib/in/use-cases/launch.mp4"
    },
    "args": [
      "-i", "walkout.mp4", "-i", "launch.mp4", "-filter_complex",
      "[0:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v0];[1:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v1];[v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]",
      "-map", "[v]", "-map", "[a]", "-c:v", "libx264", "-crf", "20",
      "-preset", "veryfast", "-c:a", "aac", "-b:a", "160k", "-movflags",
      "+faststart", "merged.mp4"
    ],
    "outputs": ["merged.mp4"]
  }'
request.mjsTry it
const res = await fetch("https://api.reelsdk.com/v1/ffmpeg?wait=60", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.REELSDK_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "inputs": {
      "walkout.mp4": "https://api.reelsdk.com/f/lib/in/use-cases/walkout.mp4",
      "launch.mp4": "https://api.reelsdk.com/f/lib/in/use-cases/launch.mp4"
    },
    "args": [
      "-i", "walkout.mp4", "-i", "launch.mp4", "-filter_complex",
      "[0:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v0];[1:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v1];[v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]",
      "-map", "[v]", "-map", "[a]", "-c:v", "libx264", "-crf", "20",
      "-preset", "veryfast", "-c:a", "aac", "-b:a", "160k", "-movflags",
      "+faststart", "merged.mp4"
    ],
    "outputs": ["merged.mp4"]
  }),
});
const { job } = await res.json();
response.json
{
  "job": {
    "id": "job_3fhzu640ebd4luum6o9y",
    "op": "ffmpeg",
    "status": "succeeded",
    "stage": null,
    "created_at": "2026-11-07T01:20:08.856Z",
    "finished_at": "2026-11-07T01:20:33.303Z",
    "outputs": {
      "merged.mp4": "https://api.reelsdk.com/f/out/job_3fhzu640ebd4luum6o9y/merged.mp4?s=..."
    },
    "result": null,
    "duration_s": 42.026,
    "error": null,
    "usage": {
      "output_seconds": 42.026,
      "audio_seconds": 0,
      "tts_characters": 0,
      "images": 0
    },
    "poll_url": "https://api.reelsdk.com/v1/jobs/job_3fhzu640ebd4luum6o9y"
  }
}

Filter vs. demuxer

You have two ways to join clips with ffmpeg 8.1 on POST /v1/ffmpeg. The concat filter decodes every input, runs your filter graph and re-encodes the combined stream into one file. In the run above, joining walkout.mp4 and launch.mp4 that way billed about 20 seconds of compute, which is about two thirds of a cent.

If your clips already have the same codecs and settings, skip re-encoding and use the concat demuxer instead. You pass a list.txt file in inputs with two lines (file 'walkout.mp4' and file 'launch.mp4'), then run -f concat -i list.txt -c copy -movflags +faststart merged-copy.mp4 in args. That second run billed under 3 seconds and cost under a tenth of a cent, though the copied file came out larger: 32.0 MB against 26.3 MB.

Concat demuxer, stream copyTry it
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
  -H "Authorization: Bearer $REELSDK_KEY" \
  --json '{
    "inputs": {
      "list.txt": "https://api.reelsdk.com/f/lib/in/use-cases/list.txt",
      "walkout.mp4": "https://api.reelsdk.com/f/lib/in/use-cases/walkout.mp4",
      "launch.mp4": "https://api.reelsdk.com/f/lib/in/use-cases/launch.mp4"
    },
    "args": [
      "-f", "concat", "-i", "list.txt", "-c", "copy", "-movflags",
      "+faststart", "merged-copy.mp4"
    ],
    "outputs": ["merged-copy.mp4"]
  }'

At a glance

Ways to merge videos

Ways to merge videos
OptionPriceLimitsWhat you run
ffmpeg on your own machineFree; LGPL 2.1 or later, or GPL 2 or later with GPL libraries such as libx264Your CPU, disk and bandwidthffmpeg builds, a job queue, storage
AWS Lambda with an ffmpeg layer$0.0000166667 per GB-second plus $0.20 per 1M requests (x86, US East)900 s per run, 10,240 MB memory and /tmp, 250 MB of code and layers, 6 MB sync payloadThe layer, S3 in and out, retries
FFmpeg Micro1 token per 10 s of input, 500 tokens for $5; 42 s of input: about 4.2 tokens, $0.04100 MB input on the free plan, 1,024 MB on Starter and ProAPI calls
Shotstack20¢ a minute of output, pay as you go; this 42 s video: 14¢1080p max on pay as you goA JSON edit with tracks and clips
ReelSDK$0.02 per compute minute; about two thirds of a cent for this 42 s merge500 MB per file, 1 GB per job, 10 minutes of run timeOne HTTP call

Sources: FFmpeg license and legal, AWS Lambda quotas, AWS Lambda pricing, FFmpeg Micro pricing, Shotstack pricing, checked November 2026.

Handling clips that don't match

The concat filter expects every input stream to match before it joins them. In the first run, both walkout.mp4 and launch.mp4 are already 1920x1080, and the filter chain still runs scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30 on [0:v] and [1:v]. Using scale with force_original_aspect_ratio=decrease plus pad keeps each clip's shape inside a 1920x1080 frame, setsar=1 sets the sample aspect ratio, and fps=30 makes the frame rates match so merged.mp4 comes out at 30 fps.

For transitions between clips instead of a hard cut, xfade is on the allowed filter list in the ffmpeg docs. When the filter graph finishes, the job encodes [v] and [a] with -c:v libx264 -crf 20 -preset veryfast -c:a aac -b:a 160k -movflags +faststart.

Limits and cost

ReelSDK charges $0.02 per compute minute, billed per second with a 1 s minimum. Machine start-up isn't billed, failed jobs cost $0, and you get $0.50 of free credit at sign-up on the pricing page. For this 42 s output, Shotstack charges 20¢ a minute of output pay as you go ($10 for 50 minutes, counted by the second and rounded down, 1080p max), which comes to 14¢.

What it costs

What this job cost

Compute: fetching the inputs, running ffmpeg and storing the file
20.5 s
Rate
$0.02 per compute minute
Charged
$0.0068

Billed per second with a 1 s minimum. Machine start-up is not billed, and failed jobs cost $0.

Limits

What one request takes

Input files
500 MB each, 1 GB per job
Job run time
Up to 10 minutes
Inputs per job
Up to 50
Waiting for a result
60 s by default, up to 300 s
Output retention
7 days

How it works

From request to file

  1. Host the input

    Any public http or https URL on the default port works, as long as it has no username or password in it; ReelSDK downloads it before ffmpeg starts. A local file goes up with POST /v1/uploads?filename=clip.mp4 first: up to 100 MiB per upload, kept 7 days, and larger files go up as a multipart upload.

  2. Send the arguments

    Each clip goes through scale and pad to 1920x1080, setsar=1 and fps=30, so clips of different sizes line up. concat=n=2:v=1:a=1 then joins video and audio in order, and -map picks the joined streams for merged.mp4.

  3. Download the result

    Every file is listed under job.outputs, and the links work for 7 days, so copy what you keep. For long jobs, send ?wait=0 with a webhook_url and fetch GET /v1/jobs/{id} when the webhook arrives.

FAQ

Questions, answered

How do I merge more than two videos, or merge clips without re-encoding?

Add up to 50 files to inputs and pass each one as an -i flag in args. For the concat filter, add a scale, pad, setsar, and fps chain for each video stream and set concat=n=2:v=1:a=1 to your clip count. If all clips share the same codecs and settings, upload a list.txt file with a file '...' line for each clip and run -f concat -i list.txt -c copy.

How do I control output quality and file size when re-encoding?

You pass standard encoder flags in the args array. The example run uses -c:v libx264 -crf 20 -preset veryfast for video and -c:a aac -b:a 160k for audio, plus -movflags +faststart. That turned the 13.4 MB and 18.6 MB inputs into a 26.3 MB merged.mp4 file, compared to 32.0 MB for merged-copy.mp4 with -c copy.

How is compute billed compared to FFmpeg Micro and AWS Lambda?

ReelSDK bills $0.02 per compute minute per second (1 s minimum) for the time spent fetching inputs, running ffmpeg and storing outputs, so the filter run cost about two thirds of a cent and the -c copy run under a tenth of a cent. FFmpeg Micro bills by input duration at 1 token per 10 s (about 4.2 tokens, roughly $0.04 at the 500-tokens-for-$5 top-up rate). AWS Lambda bills $0.0000166667 per GB-second (x86, US East) and $0.20 per 1M requests.

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains