Ffmpeg icon

Ffmpeg

A node that uses ffmpeg to transform media

Overview

This node provides a way to run custom ffmpeg commands on media files within an n8n workflow. It is designed to transform media by executing arbitrary ffmpeg command-line instructions, allowing users to manipulate audio and video files flexibly.

Common scenarios where this node is beneficial include:

  • Extracting clips or segments from videos.
  • Converting media formats.
  • Adding filters or overlays.
  • Resizing or cropping videos.
  • Encoding or decoding streams.

For example, a user might extract the first 30 seconds of a video by specifying a command like -ss 0 -i {input} -t 30 -c copy {output}, where {input} and {output} are placeholders replaced with actual file paths during execution.

Properties

Name Meaning
Output File Name The name of the output file generated by ffmpeg (e.g., "output.mp4").
Output Binary The name of the binary property in which to store the resulting media data (default: "data").
Command The ffmpeg command string to execute. Use {input} and {output} as placeholders for input and output file paths. Example: -ss 0 -i {input} -t 30 -c copy {output}.

Output

The node outputs the transformed media file in binary form under the specified binary property name (default "data"). The JSON output contains metadata about the processed item, but the main content is the binary data representing the media file after ffmpeg processing.

Dependencies

  • Requires ffmpeg installed and accessible in the environment where n8n runs.
  • No external API keys or services are needed.
  • The node relies on the bundled internal execution logic to run ffmpeg commands.

Troubleshooting

  • Common issues:

    • Incorrect ffmpeg command syntax can cause failures.
    • Missing or inaccessible input files will result in errors.
    • Output file naming conflicts or invalid names may cause write errors.
    • ffmpeg not installed or not in PATH will prevent execution.
  • Error messages:

    • Errors related to ffmpeg command execution usually indicate syntax or file path problems.
    • Permission denied errors suggest filesystem access issues.
  • Resolutions:

    • Verify the correctness of the ffmpeg command and placeholders.
    • Ensure input files exist and are accessible.
    • Confirm ffmpeg is installed and available in the system PATH.
    • Use valid filenames for output.

Links and References

Discussion