MediaFX icon

MediaFX

Process videos, audio, and media files with FFmpeg

Actions13

Overview

This node, named "MediaFX," provides media processing capabilities using FFmpeg, focusing on video, audio, subtitles, images, and fonts. Specifically for the Audio - Extract operation, it extracts the audio track from a given video source and outputs it as an audio file in a specified format.

Common scenarios where this node is beneficial include:

  • Extracting background music or dialogue from video files.
  • Converting video soundtracks into standalone audio files for podcasts or music distribution.
  • Preparing audio samples from videos for further editing or analysis.

For example, you can input a video URL or binary video data, specify the desired audio output format (e.g., MP3), and optionally configure advanced codec and bitrate settings to extract the audio track efficiently.

Properties

Name Meaning
Source Video Defines the video input source from which audio will be extracted.
  Source Type Choose between "URL" (video accessible via a web link) or "Binary Data" (video data from previous nodes).
  Value The URL of the video file (shown if Source Type is URL).
  Binary Property The name of the binary property containing the video data (shown if Source Type is Binary Data).
Output Format The format of the extracted audio file. Options: MP3, WAV, AAC, FLAC.
Advanced Options Additional encoding options for the audio extraction.
  Audio Codec Specify the audio codec to use, or "copy" to keep the original codec. Default is "copy".
  Audio Bitrate Set the audio bitrate, e.g., "192k". Default is "192k".

Output

The node outputs the extracted audio file as binary data attached to the data binary property by default. The output includes:

  • json: An empty JSON object {} indicating no additional metadata is returned.
  • binary.data: Contains the extracted audio file in the selected format (MP3, WAV, AAC, or FLAC).
  • The binary data is prepared with the appropriate filename extension matching the chosen output format.

This allows downstream nodes to consume or save the extracted audio file directly.

Dependencies

  • Requires FFmpeg installed and accessible in the environment where n8n runs, as all media processing relies on FFmpeg commands.
  • No external API keys or services are needed.
  • Uses internal helper functions to handle temporary files and binary data conversion.

Troubleshooting

  • No binary data found error: If using binary input, ensure the specified binary property exists and contains valid video data.
  • File not found or inaccessible URL: When using a URL source, verify that the URL is reachable and points to a valid video file.
  • Unsupported codec or format errors: If specifying an audio codec other than "copy", ensure FFmpeg supports the codec and the input video contains compatible audio streams.
  • Temporary file cleanup issues: Occasionally, leftover temp files may accumulate; the node attempts periodic cleanup but manual intervention might be necessary.
  • Operation did not produce output: This error indicates the extraction failed silently; check input validity and FFmpeg logs if possible.

To resolve most issues, verify inputs, confirm FFmpeg installation, and test with known good video files.

Links and References

Discussion