n8nautomationvideo workflowstutorialffmpeg

How to Use FFmpeg with n8n for Video Editing Workflows

·FFmpeg Micro Team·8 min read
How to Use FFmpeg with n8n for Video Editing Workflows

Half your business is already automated with n8n. Emails, CRM updates, Slack notifications, data pipelines. But every time a video needs processing, the automation stops and a human takes over.

Resize this for Instagram. Transcode that for the website. Add the watermark. Convert the format.

That gap in your workflow doesn't need to exist.

This tutorial walks through building a complete video editing workflow in n8n using FFmpeg Micro's API. No servers, no FFmpeg installation, no Docker containers. Just HTTP Request nodes.

Why Running FFmpeg in n8n Doesn't Work

If you've tried this, you know.

n8n.cloud doesn't have FFmpeg installed. The Execute Command node doesn't exist on cloud. Self-hosted? You'd need FFmpeg on every worker, codec libraries maintained, updates handled. And when someone uploads a video encoded by software from 2003, you're debugging cryptic errors at midnight.

Binary data handling is painful too. Moving large video files between n8n nodes, converting buffers to files, managing temp storage. It breaks at scale.

And FFmpeg syntax is its own language:

ffmpeg -i input.mov -i watermark.png -filter_complex "[0:v][1:v]overlay=W-w-10:H-h-10,scale=1280:720" -c:v libx264 -preset medium -crf 23 -c:a aac output.mp4

Nobody wants to debug that inside a Code node.

The fix: treat FFmpeg as an API call. FFmpeg Micro runs FFmpeg in the cloud and exposes it as REST. In n8n, that's just an HTTP Request node. Same as calling any other API.

What You'll Build

By the end of this, you'll have an n8n workflow that:

  1. Uploads a video file to FFmpeg Micro's secure storage
  2. Transcodes it to web-optimized H.264/AAC
  3. Resizes it for different platforms (1080p, 720p, vertical for Reels/TikTok)
  4. Adds a watermark overlay
  5. Batch processes multiple videos in a loop

Each step is one HTTP Request node.

Prerequisites

  • n8n.cloud account (or self-hosted, both work)
  • FFmpeg Micro account. Sign up free, 100 minutes included
  • Your API key from the FFmpeg Micro dashboard

That's it. No FFmpeg installation. No Docker.

Step 1: Set Up Credentials in n8n

Store your API key as a credential so you don't hardcode it everywhere.

  1. In n8n, go to Credentials, then Add Credential
  2. Choose Header Auth
  3. Header name: Authorization. Value: Bearer YOUR_API_KEY
  4. Name it "FFmpeg Micro API" and save

Every HTTP Request node can now reference this credential.

Step 2: Upload a Video File

FFmpeg Micro uses presigned URLs for secure uploads. Request an upload URL, then PUT your file to it.

Get Upload URL (HTTP Request node):

  • Method: POST
  • URL: https://api.ffmpeg-micro.com/v1/upload/presigned-url
  • Authentication: your FFmpeg Micro API credential
  • Body (JSON):
{
  "filename": "input.mov",
  "contentType": "video/quicktime",
  "fileSize": 52428800
}

The response gives you a uploadUrl for uploading and a filename for later steps.

Upload the File (second HTTP Request node):

  • Method: PUT
  • URL: {{ .uploadUrl }}
  • Body: Binary, select your video file
  • Headers: Content-Type matching the file type

Video is now in FFmpeg Micro's cloud storage, ready for processing.

Step 3: Transcode a Video

Most common operation. Any format to web-optimized MP4.

HTTP Request node:

  • Method: POST
  • URL: https://api.ffmpeg-micro.com/v1/transcodes
  • Authentication: FFmpeg Micro API credential
  • Body:
{
  "inputs": [{"url": "{{ .item.json.fileUrl }}"}],
  "outputFormat": "mp4",
  "options": [
    {"option": "-s", "argument": "1280x720"},
    {"option": "-c:v", "argument": "libx264"},
    {"option": "-preset", "argument": "medium"},
    {"option": "-c:a", "argument": "aac"}
  ]
}

One node. FFmpeg Micro handles codec detection, format conversion, optimization. The web-720p preset outputs H.264 video with AAC audio at 720p.

Need more control? Use custom FFmpeg arguments:

{
  "inputs": [{"url": "{{ .item.json.fileUrl }}"}],
  "options": [
    "-c:v", "libx264",
    "-preset", "medium",
    "-crf", "23",
    "-c:a", "aac",
    "-b:a", "128k"
  ]
}

Full FFmpeg power. 400+ options. No installation.

Step 4: Resize for Multiple Platforms

One video, three platform-specific versions. This is where n8n's visual workflow shines. Add three parallel HTTP Request nodes after your transcode step, one per platform.

YouTube (1080p landscape):

{
  "inputs": [{"url": "{{ .item.json.fileUrl }}"}],
  "options": [
    "-vf", "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2",
    "-c:v", "libx264",
    "-preset", "medium",
    "-c:a", "aac"
  ]
}

Instagram Reels / TikTok (1080x1920 vertical):

{
  "inputs": [{"url": "{{ .item.json.fileUrl }}"}],
  "options": [
    "-vf", "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2",
    "-c:v", "libx264",
    "-preset", "medium",
    "-t", "60",
    "-c:a", "aac"
  ]
}

The -t 60 caps it at 60 seconds. Reels max at 90s but shorter clips perform better.

Twitter / X (720p square):

{
  "inputs": [{"url": "{{ .item.json.fileUrl }}"}],
  "options": [
    "-vf", "scale=720:720:force_original_aspect_ratio=decrease,pad=720:720:(ow-iw)/2:(oh-ih)/2",
    "-c:v", "libx264",
    "-t", "140",
    "-c:a", "aac"
  ]
}

Connect all three as parallel branches from the same source node. They run concurrently.

Step 5: Add a Watermark

Logo overlay using FFmpeg's overlay filter. FFmpeg Micro supports it natively.

{
  "inputs": [{"url": "{{ .item.json.fileUrl }}"}],
  "options": [
    "-i", "https://yourdomain.com/logo.png",
    "-filter_complex", "[0:v][1:v]overlay=W-w-10:H-h-10",
    "-c:a", "copy"
  ]
}

This puts your logo bottom-right with a 10px margin. Other positions:

  • Top-left: overlay=10:10
  • Top-right: overlay=W-w-10:10
  • Bottom-left: overlay=10:H-h-10
  • Center: overlay=(W-w)/2:(H-h)/2

The watermark image gets fetched via URL. No separate upload needed. Host it on S3, your CDN, wherever.

Step 6: Wait for Job Completion

FFmpeg Micro processes asynchronously. Two ways to handle this in n8n.

Polling (simpler):

Use a Wait node + IF node in a loop:

  1. Wait node: pause 10 seconds
  2. HTTP Request: GET https://api.ffmpeg-micro.com/v1/transcodes/{{ .id }}
  3. IF node: check if {{ .status }} equals completed
  4. If true, continue to download. If false, loop back to Wait.

Webhook (better for production):

Include a webhook URL when creating the job:

{
  "inputs": [{"url": "{{ .item.json.fileUrl }}"}],
  "outputFormat": "mp4",
  "options": [
    {"option": "-s", "argument": "1280x720"},
    {"option": "-c:v", "argument": "libx264"},
    {"option": "-preset", "argument": "medium"},
    {"option": "-c:a", "argument": "aac"}
  ],
  "webhook_url": "https://your-n8n-instance.app.n8n.cloud/webhook/ffmpeg-complete"
}

Create a separate n8n workflow with a Webhook trigger. FFmpeg Micro POSTs the result when the job finishes. No polling.

Step 7: Batch Process Multiple Videos

This is where the investment pays off. 10, 50, 500 videos. Zero manual work.

Loop over a list. Start with a Google Sheets node containing video URLs. Each row flows through your processing nodes automatically:

Google Sheets > Upload > Transcode > Resize > Watermark > Save Result

Add a row, get a processed video.

Watch a folder. Google Drive Trigger or S3 Trigger detects new uploads. Video lands in the folder, workflow fires.

Schedule it. Schedule Trigger runs your batch at specific times. Process everything uploaded during the day in one overnight run.

Skip the Setup: Download Pre-Built Workflows

We built the whole thing for you.

Download the complete n8n workflow templates. The ZIP contains four ready-to-import n8n workflows:

  1. MAIN Controller. Orchestrates the full pipeline.
  2. [SUB] Upload File. Handles secure file upload via presigned URL.
  3. [SUB] Extract Metadata. Pulls video info before processing.
  4. [SUB] Wait for Transcode. Manages async job completion with polling.

Import into n8n, add your API key, done. There's also a video walkthrough showing the entire setup end to end.

What It Costs

ComponentCost
n8n.cloud$20/month (free trial available)
FFmpeg MicroFree tier: 100 min/month. Starter: $19/month for 2,000 min
TotalFree to start. $39/month covers most use cases.

No server maintenance. No DevOps time.

100 videos per month at 2 minutes each = 200 minutes. That fits in the $19/month Starter plan.

Workflow Ideas

Social media repurposing. Podcast drops into Google Drive. n8n extracts highlight clips, resizes for YouTube Shorts, Reels, and TikTok, adds branded intro, pushes to scheduling tools.

Agency video processing. Client uploads raw footage to a shared folder. n8n transcodes to delivery specs, adds watermark, emails a download link, logs the job in Airtable for billing.

E-commerce product videos. Team uploads demos. n8n creates web-optimized versions, generates thumbnails, cuts social clips, updates product listings via Shopify API.

Course content pipeline. Instructor records a lesson. n8n transcodes to multiple quality levels, extracts audio for a podcast feed, generates a thumbnail, publishes to the course platform.

Troubleshooting

Job stays in "processing" for a long time.
Processing time depends on file size and complexity. A 10-minute 1080p video usually takes 1-3 minutes. Over 10 minutes? Check the job status endpoint for error details.

Watermark looks blurry.
Use a PNG with transparency, at least 200-300px wide. FFmpeg won't upscale a tiny logo to look good at 1080p.

Vertical video has black bars.
That's the pad filter working correctly. It prevents stretching. If you want to crop instead, swap pad for crop in the filter chain.

n8n says "connection refused."
Check your API key in the credential settings. It should be Bearer YOUR_API_KEY with the word Bearer and a space before the key.

Go Deeper

FFmpeg Micro turns FFmpeg commands into API calls. No servers, no installation. 100 free minutes to start. Create your free account.

Ready to process videos at scale?

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

Get Started Free