ffmpegautomationapivideo-processingn8n

How to Automate Video Editing with FFmpeg

·Javid Jamae·5 min read
How to Automate Video Editing with FFmpeg

The Problem With Manual FFmpeg Commands

You've got a working FFmpeg command. Maybe it converts uploads to MP4, or generates thumbnails for a video library. It works great when you run it by hand.

But then your app needs to process 50 videos overnight. Or your client wants watermarks added to every upload automatically. Or your marketing team needs 20 social clips cut from a webinar recording by Monday morning.

Running FFmpeg commands manually doesn't scale. And building your own queue, worker infrastructure, and error handling around FFmpeg is a multi-week project that has nothing to do with your actual product.

Replace CLI Commands With API Calls

The simplest form of FFmpeg automation is swapping a local CLI command for an HTTP request. Instead of running ffmpeg -i input.mp4 -c:v libx264 -crf 23 output.mp4 on your machine, you send a POST request and get the result back.

With FFmpeg Micro, that looks like this:

curl -X POST https://api.ffmpeg-micro.com/v1/transcodes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [{"url": "https://storage.example.com/video.mp4"}],
    "outputFormat": "mp4",
    "preset": {"quality": "medium", "resolution": "1080p"}
  }'

That's it. No server to maintain, no FFmpeg binary to install, no dependency conflicts. The API accepts your input URL, processes the video in the cloud, and gives you a download link when it's done.

Upload, Process, Download: The Full Flow

For files that aren't already hosted somewhere, FFmpeg Micro uses a 3-step upload process:

  1. Request a presigned upload URL via POST /v1/upload/presigned-url
  2. PUT your file directly to cloud storage using that URL
  3. Confirm the upload via POST /v1/upload/confirm to get your permanent fileUrl

Once you have the fileUrl, pass it as the input to your transcode job. The response includes a job ID you can poll for status or wait for a webhook callback.

{
  "inputs": [{"url": "gs://your-bucket/uploaded-video.mp4"}],
  "outputFormat": "webm",
  "options": [
    {"option": "-c:v", "argument": "libvpx-vp9"},
    {"option": "-crf", "argument": "30"},
    {"option": "-b:v", "argument": "0"}
  ]
}

The options array gives you full FFmpeg flag control when presets aren't enough. Every valid FFmpeg codec and filter works here.

Automation Patterns That Actually Work

Webhook-Driven Processing

Most real automation doesn't poll for results. You set up a webhook URL, and FFmpeg Micro POSTs the result back when the job finishes. Your app receives the completed file URL and continues its workflow without blocking.

This pattern works especially well with n8n or Make.com. Your automation platform receives the webhook, then routes the output wherever it needs to go: upload to S3, update a database record, notify a Slack channel, trigger the next step.

Batch Processing With Simple Loops

Need to convert 200 videos from MOV to MP4? Don't overthink it. Loop through your file list, fire off a transcode request for each one, and collect results via webhooks.

for file_url in "${VIDEO_URLS[@]}"; do
  curl -s -X POST https://api.ffmpeg-micro.com/v1/transcodes \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d "{
      \"inputs\": [{\"url\": \"$file_url\"}],
      \"outputFormat\": \"mp4\",
      \"preset\": {\"quality\": \"high\", \"resolution\": \"1080p\"}
    }"
done

FFmpeg Micro handles the scaling. Whether you send 5 jobs or 500, the infrastructure auto-scales to match. You don't need to provision workers or manage queues.

n8n and Make.com Integration

Both n8n and Make.com can call the FFmpeg Micro API directly using HTTP request nodes. The typical workflow looks like:

  • Trigger fires (new file uploaded, scheduled time, form submission)
  • HTTP node sends POST to /v1/transcodes with the file URL and desired output
  • Wait node pauses until the webhook fires back
  • Next nodes handle the output (move file, notify user, update CMS)

No custom code required. The entire automation lives in a visual workflow builder.

Scaling From 1 to 1000 Videos

The difference between processing 1 video and 1000 videos should be zero code changes. With an API-driven approach, scaling means sending more requests. That's it.

FFmpeg Micro runs on auto-scaling Cloud Run infrastructure. Each job gets its own compute resources. You're never waiting for someone else's video to finish before yours starts processing. And you only pay for actual processing time, not idle servers.

For high-volume use cases (content platforms processing thousands of uploads daily), the API supports up to 10 inputs per request for concatenation workflows, and concurrent job limits scale with your plan.

When to Automate vs. When to Stay Manual

Automation makes sense when you're doing the same FFmpeg operation repeatedly with different inputs. If you're converting every user upload to a standard format, generating thumbnails on a schedule, or cutting clips from longer videos based on timestamps, that's automation territory.

If you're doing one-off creative edits where you're tweaking parameters by eye? Keep using the CLI directly. Automation is for the repetitive stuff.

FAQ

Can I use any FFmpeg command through the API?

Yes. The options array in the transcode request accepts any valid FFmpeg flags. If it works in your terminal, it works through the API. You can also use presets for common operations like quality/resolution changes without knowing FFmpeg syntax.

How long does a typical video transcode take?

Processing time depends on input duration, resolution, and codec. A 5-minute 1080p MP4 to WebM conversion typically takes 30-60 seconds. The API returns a job ID immediately so your app doesn't block.

What happens if a job fails?

Failed jobs return a clear error message with the FFmpeg stderr output. You can retry with different parameters, or check the logs via GET /v1/transcodes/:id to see exactly what went wrong.

Does it work with Make.com and n8n?

Both platforms can call FFmpeg Micro using their built-in HTTP request modules. No custom plugins or integrations needed. Send a POST, receive a webhook when it's done.

What video formats are supported?

Input and output: MP4, WebM, AVI, MOV, MKV, FLV for video. MP3, M4A, AAC, WAV, OGG, Opus, FLAC for audio. JPEG, PNG, GIF, WebP for images.

Ready to process videos at scale?

Start using FFmpeg Micro's simple API today. No infrastructure required.

Get Started Free