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, focusing here on the Convert operation. It allows users to convert audio and video files from one format to another by specifying input files and desired output formats. This is useful for scenarios such as transcoding videos for compatibility with different devices, compressing audio files, or changing file formats for editing or streaming purposes.

For example, you can convert an MP4 video to WebM format for web use, or convert WAV audio files to MP3 to reduce file size while maintaining quality.

Properties

Name Meaning
Output File Name The name of the output file. The file extension will be automatically set based on the selected output format.
Output Binary Property The name of the binary property in which the converted file data will be stored in the output.
Bitrate (e.g., 192k) Optional audio bitrate setting for the conversion (e.g., 128k, 192k, 256k). If left empty, FFmpeg's default bitrate is used.
FFmpeg Convert Arguments A customizable FFmpeg command template for conversion. Supports placeholders {input} for input file path, {output} for output file path, and {bitrate_option} for optional bitrate parameters. Example: -i "{input}" -c:v copy -c:a aac{bitrate_option} "{output}"
Output Format The desired output format for the converted file. Determines the file extension and MIME type. Supported formats include AAC, FLAC, GIF, MKV, MOV, MP3, MP4, OGG, WAV, and WebM.

Output

The node outputs the converted media file as binary data under the specified output binary property name. The output JSON contains metadata about the conversion result, including the binary data representing the converted file. The binary data can then be used downstream in workflows for saving to disk, uploading, or further processing.

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 to provide source media files.

Troubleshooting

  • Common issues:

    • FFmpeg not found or not installed: Ensure FFmpeg is installed and available in the system PATH.
    • Unsupported input format: Verify that the input media file format is supported by FFmpeg.
    • Incorrect FFmpeg arguments: Custom FFmpeg command templates must use correct syntax and valid placeholders.
    • Output file naming conflicts: Make sure the output file name does not conflict with existing files or invalid characters.
  • Error messages:

    • Errors related to missing input files or invalid paths usually indicate problems with the input binary data.
    • FFmpeg execution errors often point to incorrect command arguments or unsupported codec/format combinations.

Resolving these typically involves checking the input data, verifying FFmpeg installation, and reviewing custom command syntax.

Links and References

Discussion