Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Image, Video & Audio

Image, Video & Audio

Combine mismatched video clips into one MP4 with FFmpeg from a form upload

Runs on each form submission, accepts two or more video clips with mixed resolutions and frame rates, and joins them into one MP4 using FFmpeg's concat filter locally with no paid API.

What it does

## Combine any number of video clips into one MP4 with FFmpeg (free, no API) Upload two or more video clips - even mismatched ones, different resolutions, aspect ratios, frame rates - and get back one combined MP4. No API key, no account, no paid service: FFmpeg's concat filter does the real work, running for free on your own machine. This is the clip-joining step from a larger faceless-video pipeline, pulled out on its own because "just concatenate these files" is one of the most common FFmpeg questions there is, and the naive approach (the concat demuxer) silently produces a broken or out-of-sync file the moment two clips don't share the exact same codec settings. ### How it works 1. A form takes two or more video files and a target output size (1920x1080 landscape, 1080x1920 vertical, or 1080x1080 square). 2. Every clip is saved to a per-run temp folder in upload order - that order is the concat order. 3. FFmpeg's concat filter (not the concat demuxer) is used: each clip is scaled to fit inside the target frame without stretching or cropping, letterboxed if needed, normalized to 30fps, and its audio is reformatted to a common sample rate - so mismatched clips still join cleanly instead of desyncing. 4. The combined MP4 is read back off disk and returned with a short report (clip count, output size). ### Setup Self-hosted n8n only - this uses Execute Command, which n8n Cloud disables. Install FFmpeg on the PATH of the process running n8n, and start n8n with NODES_EXCLUDE="[]" and N8N_RESTRICT_FILE_ACCESS_TO="/tmp" - both are required or the file steps fail without a clear error.

The steps

  1. Video clips and output format form
  2. Prepare Run
  3. Create the temp folder
  4. Restore the uploaded clips
  5. Split into one item per clip
  6. Save each clip to disk
  7. Build the FFmpeg command
  8. Combine all clips (FFmpeg)
  9. Verify the combine succeeded
  10. Read the combined video back
  11. Attach the combine report to the file

Similar automations