{"product_id":"n8n-workflow-merge-video-clips-to-mp4-with-ffmpeg","title":"n8n Workflow: Merge Video Clips to MP4 with FFmpeg","description":"\u003ch3\u003eMerge Multiple Video Clips into One MP4 (Automatically) with n8n + FFmpeg\u003c\/h3\u003e\n\u003cp\u003eThis self-hosted n8n workflow takes two or more uploaded video clips, scales and pads them to your chosen output size (landscape, vertical, or square), and merges everything into a single MP4 using \u003cstrong\u003eFFmpeg’s concat filter\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a form submission\u003c\/strong\u003e with at least two video files plus a selected output size.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates a per-run temporary folder\u003c\/strong\u003e and generates an ordered list of clip paths, along with the target width\/height.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSaves the uploaded clips to disk\u003c\/strong\u003e in the exact order the user selected them.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds and runs an FFmpeg command\u003c\/strong\u003e that:\n    \u003cul\u003e\n      \u003cli\u003escales and pads each clip to the target frame,\u003c\/li\u003e\n      \u003cli\u003enormalizes video to \u003cstrong\u003e30 fps\u003c\/strong\u003e,\u003c\/li\u003e\n      \u003cli\u003ereformats audio to a common sample rate\/layout,\u003c\/li\u003e\n      \u003cli\u003ethen \u003cstrong\u003econcatenates all clips into one MP4\u003c\/strong\u003e using FFmpeg concat filter (not the concat demuxer).\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFails safely\u003c\/strong\u003e: if the merge fails, the workflow stops with FFmpeg’s stderr output.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns the merged MP4\u003c\/strong\u003e plus a brief report including clip count and output dimensions.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eQuickly combine multiple clips into one video for \u003cstrong\u003esocial media\u003c\/strong\u003e with consistent sizing.\u003c\/li\u003e\n  \u003cli\u003eBatch-create \u003cstrong\u003ecompilation MP4s\u003c\/strong\u003e from user uploads in an internal tool.\u003c\/li\u003e\n  \u003cli\u003eStandardize mixed source formats by forcing a uniform resolution and frame rate before publishing.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSelf-hosted n8n required\u003c\/strong\u003e (uses the \u003cem\u003eExecute Command\u003c\/em\u003e node; does not run on n8n Cloud).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFFmpeg installation\u003c\/strong\u003e on the same machine; ensure the \u003ccode\u003effmpeg\u003c\/code\u003e binary is on the PATH for the n8n process.\u003c\/li\u003e\n  \u003cli\u003eFile access configured for \u003cstrong\u003e\/tmp\u003c\/strong\u003e (e.g., \u003ccode\u003eN8N_RESTRICT_FILE_ACCESS_TO=\"\/tmp\"\u003c\/code\u003e) so the workflow can write inputs and read the resulting MP4.\u003c\/li\u003e\n  \u003cli\u003eImplemented with nodes: \u003cstrong\u003eCode\u003c\/strong\u003e, \u003cstrong\u003eSticky Note\u003c\/strong\u003e, \u003cstrong\u003eForm Trigger\u003c\/strong\u003e, \u003cstrong\u003eRead\/Write File\u003c\/strong\u003e, and \u003cstrong\u003eExecute Command\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45872818487475,"sku":"N8N-18485","price":36.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/6_N7b5ShiUGIXBGYwFvGg_JEshSAo9.png?v=1787216751","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-merge-video-clips-to-mp4-with-ffmpeg","provider":"N8N Commerce","version":"1.0","type":"link"}