Ffmpeg icon

Ffmpeg

Merge, overlay, get info, convert, or run custom FFmpeg commands on media files. FFmpeg supports a wide range of input formats.

Overview

This node provides media file manipulation using FFmpeg, a powerful multimedia framework. Specifically, the "Merge Videos" operation allows users to combine multiple video files into a single output video. This is useful in scenarios such as creating highlight reels, combining clips from different sources, or stitching together recorded segments into one continuous video.

For example, if you have several short video clips from an event and want to create a single video file for easier sharing or uploading, this node can merge those clips seamlessly.

Properties

Name Meaning
Minimum Files to Merge The minimum number of input video files required before the merge operation can proceed (default: 2).
Output File Name The name of the resulting merged video file. The extension will be set automatically based on context.
Output Binary Property The name of the binary property where the merged video data will be stored in the output item.
FFmpeg Merge Arguments Custom FFmpeg command template for merging videos. Use {input} as placeholder for concat file and {output} for output file. Default is -f concat -safe 0 -i "{input}" -c:v libx264 -c:a aac "{output}".

Output

The node outputs a single item containing the merged video file in its binary data under the specified output binary property. The binary data represents the combined video file ready for further processing or saving.

The JSON part of the output typically contains metadata about the operation or file but primarily the merged video is available as binary data.

Dependencies

  • Requires FFmpeg installed and accessible in the environment where n8n runs.
  • No external API keys or services are needed; all processing is local via FFmpeg.
  • Proper configuration of the node’s input files as binary data is necessary.

Troubleshooting

  • Insufficient Input Files: If fewer than the specified minimum files are provided, the merge operation may fail or produce unexpected results. Ensure at least the minimum number of files are supplied.
  • FFmpeg Command Errors: Custom FFmpeg arguments must be valid. Incorrect syntax or placeholders not replaced properly can cause errors. Use the default command as a reference.
  • File Format Compatibility: Input files should be compatible with FFmpeg concat demuxer requirements (e.g., same codec, format). Mismatched formats might cause merge failures.
  • Binary Data Issues: Make sure input files are correctly passed as binary data properties; otherwise, the node cannot process them.

Links and References

Discussion