Ffmpeg
Overview
This node provides a versatile interface to manipulate media files using FFmpeg, a powerful multimedia framework. It supports multiple operations including merging videos, overlaying audio on video, retrieving media file information, converting media formats, and running custom FFmpeg commands.
Common scenarios where this node is beneficial include:
- Combining multiple video clips into one seamless video.
- Adding an audio track to a video file.
- Extracting metadata or technical details from media files.
- Converting media files between various audio and video formats.
- Applying custom FFmpeg filters or transformations not covered by predefined operations.
For example, you could merge several MP4 videos into a single MKV file, overlay an MP3 audio track onto a video, convert a WAV audio file to MP3 format, or run a custom command to rotate a video 90 degrees clockwise.
Properties
| Name | Meaning |
|---|---|
| Operation | Choose the operation to perform: Merge Videos, Overlay Audio, Info (get media info), Convert, or Custom Command. |
| Minimum Files to Merge | (Only for Merge) The minimum number of input files required before performing a merge operation. |
| Output File Name | Name of the output file. For the Convert operation, the extension will be automatically set based on the selected output format. |
| Output Binary Property | Name of the binary property in which the output data will be stored. |
| FFmpeg Merge Arguments | (Only for Merge) Custom FFmpeg command template for merging videos. Use {input} as the concat file list and {output} as the output file path. |
| FFmpeg Overlay Arguments | (Only for Overlay) Custom FFmpeg command template for overlaying audio on video. Placeholders: {video}, {audio}, {output}. |
| Custom FFmpeg Command | (Only for Custom Command) Enter your own FFmpeg command line. Use {input} for the input file and {output} for the output file. |
| Bitrate | (Only for Convert) Optional audio bitrate setting (e.g., 128k, 192k). Leave empty to use FFmpeg's default bitrate. |
| FFmpeg Convert Arguments | (Only for Convert) FFmpeg command template for conversion. Supports placeholders {input}, {output}, and {bitrate_option}. The output file extension is determined by the selected output format. |
| Output Format | (Only for Convert) Select the desired output format, which determines the file extension and MIME type. Options include AAC, FLAC, GIF, MKV, MOV, MP3, MP4, OGG, WAV, WebM. |
Output
The node outputs the processed media file(s) as binary data attached to the specified output binary property. The json output field contains metadata about the processed file(s), such as filename and possibly other relevant information depending on the operation.
If the operation is "Info," the output JSON will contain detailed media information extracted from the input files.
Binary data represents the actual media content resulting from the FFmpeg processing, ready for further workflow steps or saving to disk.
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 binary data is necessary (media files must be provided as binary inputs).
Troubleshooting
Common Issues:
- FFmpeg not found or not installed: Ensure FFmpeg is installed and available in the system PATH.
- Incorrect input binary data: Input files must be correctly passed as binary data; otherwise, FFmpeg commands will fail.
- Invalid FFmpeg command syntax in custom commands: Verify the correctness of custom FFmpeg arguments and placeholders.
- Insufficient input files for merge operation: The number of input files must meet or exceed the "Minimum Files to Merge" setting.
Error Messages:
- Errors related to missing input files or invalid paths usually indicate problems with input binary data or parameter misconfiguration.
- FFmpeg execution errors often provide hints about incorrect command syntax or unsupported formats.
To resolve issues, verify input data, check FFmpeg installation, and review custom command syntax carefully.