DEV Community

Javid Jamae
Javid Jamae

Posted on • Originally published at ffmpeg-micro.com

FFmpeg in n8n: 5 Video Automations You Can Ship Today

Originally published at ffmpeg-micro.com.

You've connected n8n to your video sources. Maybe it's a Google Drive trigger, a webhook from your CMS, or a scheduled batch job. Now you need to actually do something with those videos. Trim them, resize them, convert formats, add watermarks.

Running FFmpeg locally on your n8n server is one option, but it's fragile and doesn't work on n8n Cloud. Calling a cloud FFmpeg API from the HTTP Request node is simpler and scales without touching your infrastructure.

Here are five video automations you can build in n8n right now using FFmpeg Micro's API. Each one is a single HTTP Request node with a JSON body you can copy and paste.

1. Auto-generate thumbnails from uploaded videos

Every video platform needs thumbnails. Instead of asking users to upload a separate image, extract a frame automatically.

The trick: transcode a single frame at a specific timestamp into an image-friendly format. Use FFmpeg's -ss flag to seek to the right moment and -frames:v 1 to grab exactly one frame.

{
  "inputs": [
    { "url": "https://your-bucket.storage.com/uploaded-video.mp4" }
  ],
  "outputFormat": "mp4",
  "options": [
    { "option": "-ss", "argument": "5" },
    { "option": "-frames:v", "argument": "1" },
    { "option": "-f", "argument": "image2" },
    { "option": "-q:v", "argument": "2" }
  ]
}
Enter fullscreen mode Exit fullscreen mode

POST this to https://api.ffmpeg-micro.com/v1/transcodes with your API key as a Bearer token. Poll GET /v1/transcodes/{id} until status is completed, then grab the output from GET /v1/transcodes/{id}/download.

Wire this into an n8n workflow triggered by a file upload webhook, and every new video gets a thumbnail without anyone lifting a finger.

2. Convert videos to web-friendly MP4

Users upload all kinds of formats. MOV from iPhones, MKV from screen recorders, AVI from legacy tools. Your web player needs MP4 with H.264 video and AAC audio.

{
  "inputs": [
    { "url": "https://your-bucket.storage.com/uploaded-video.mkv" }
  ],
  "outputFormat": "mp4",
  "preset": {
    "quality": "high",
    "resolution": "1080p"
  }
}
Enter fullscreen mode Exit fullscreen mode

The preset approach is the simplest. Set quality to high, medium, or low (maps to FFmpeg CRF values of 18, 23, and 28). Set resolution to cap the output size. Done.

This is the automation most teams build first. Trigger it from a Google Drive watch, an S3 event, or a database row creation. The converted file lands in your output bucket ready for streaming.

3. Batch resize videos for social media

One source video needs to become three: 1080p for YouTube, 720p for Twitter/X, and 480p for mobile fallback. Instead of running three manual conversions, loop through the sizes in n8n.

In your n8n workflow, use a SplitInBatches node feeding into an HTTP Request node. For each resolution, POST:

{
  "inputs": [
    { "url": "https://your-bucket.storage.com/source-video.mp4" }
  ],
  "outputFormat": "mp4",
  "preset": {
    "quality": "medium",
    "resolution": "{{ $json.resolution }}"
  }
}
Enter fullscreen mode Exit fullscreen mode

Set up the SplitInBatches node with three items:

[
  { "resolution": "1080p", "label": "youtube" },
  { "resolution": "720p", "label": "twitter" },
  { "resolution": "480p", "label": "mobile" }
]
Enter fullscreen mode Exit fullscreen mode

Each iteration fires a separate transcode job. n8n handles the orchestration. You end up with three optimized versions from one upload.

4. Add a watermark to client deliverables

Agencies and freelancers: you send preview videos with a watermark, then deliver the clean version after payment. Automate the watermark step so it happens the moment a video is uploaded.

FFmpeg Micro supports the @text-overlay virtual option for text watermarks:

{
  "inputs": [
    { "url": "https://your-bucket.storage.com/client-video.mp4" }
  ],
  "outputFormat": "mp4",
  "options": [
    {
      "option": "@text-overlay",
      "argument": {
        "text": "PREVIEW - youragency.com",
        "style": {
          "fontSize": 36,
          "x": "(w-text_w)/2",
          "y": "(h-text_h)/2",
          "boxBorderW": 8
        }
      }
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

The x and y expressions center the watermark on the video. boxBorderW adds a background box behind the text so it's readable on any footage. Adjust fontSize to match your video resolution.

Build the n8n workflow: trigger on file upload, run the watermark transcode, save the result alongside the original, notify the team via Slack or email.

5. Compress videos before archiving

Storage costs add up. If you're archiving old project files, user uploads, or training recordings, compress them first. A good H.264 encode at medium quality can cut file size 50-70% with barely noticeable quality loss.

{
  "inputs": [
    { "url": "https://your-bucket.storage.com/archive-video.mp4" }
  ],
  "outputFormat": "mp4",
  "options": [
    { "option": "-c:v", "argument": "libx264" },
    { "option": "-crf", "argument": "28" },
    { "option": "-preset", "argument": "slow" },
    { "option": "-c:a", "argument": "aac" },
    { "option": "-b:a", "argument": "96k" }
  ]
}
Enter fullscreen mode Exit fullscreen mode

CRF 28 is aggressive but perfectly fine for archival video that won't be edited again. The slow preset trades encoding speed for better compression. Audio gets dropped to 96kbps AAC, which is enough for voice-heavy content.

Schedule this as a weekly n8n workflow that scans for videos older than 30 days, compresses them, replaces the originals, and logs the space savings.

The shared setup across all five

Every automation above follows the same pattern:

  1. POST to https://api.ffmpeg-micro.com/v1/transcodes with your JSON body
  2. Poll GET /v1/transcodes/{id} until status is completed
  3. Download via GET /v1/transcodes/{id}/download to get a signed URL

Authentication is a Bearer token in the Authorization header. Set it up once as an n8n credential (Header Auth type) and reuse it across all your video nodes.

The API accepts public URLs as input, so you can pass links from S3, Google Cloud Storage, Cloudflare R2, or any CDN directly. No pre-upload step needed for files that are already publicly accessible.

FAQ

Do I need to install anything on my n8n server?
No. Everything runs through HTTP Request nodes. Works on n8n Cloud and self-hosted installs with zero dependencies.

Can I chain multiple operations?
Not in a single API call (yet). But you can chain them in n8n. Take the output URL from one transcode and use it as the input for the next. Resize first, then add a watermark, for example.

What happens if a job fails mid-workflow?
The transcode status will be failed with an error_message. Add an IF node after your polling loop to check for failures and route to an error handler (Slack notification, email alert, retry logic).

How much does this cost?
FFmpeg Micro bills per minute of video processed. There's a free tier with 10 minutes per month. Enough to test all five automations on short clips. Paid plans scale from there.

Can I process audio files too?
Yes. The API accepts MP3, WAV, FLAC, and AAC. Same endpoint, same workflow. Useful for podcast post-processing, audio normalization, or format conversion.

Top comments (0)