MediaFX icon

MediaFX

Process videos, audio, and media files with FFmpeg

Actions15

Overview

The node provides advanced media processing capabilities focused on audio and video manipulation using FFmpeg. Specifically, the Audio - Mix operation allows users to mix two audio sources together with fine control over volume levels, timing, looping, and fade effects.

This operation is useful when you want to combine a primary audio or video source with a secondary audio track, for example:

  • Adding background music to a video or podcast.
  • Overlaying sound effects onto an existing audio recording.
  • Mixing voiceover audio with original video soundtracks.
  • Creating audio mashups by blending two tracks with volume and timing adjustments.

Users can input sources either as URLs or binary data, adjust volumes independently, and optionally insert the secondary audio partially within a specific time range with looping and fade-in/out effects.

Properties

Name Meaning
Primary Source Type Selects the type of primary source input: URL or Binary Data.
Primary Source URL URL of the primary video or audio source (used if Primary Source Type is URL).
Primary Source Binary Property Name of the binary property containing the primary source data (used if Primary Source Type is Binary Data).
Secondary Audio Source Type Selects the type of secondary audio source input: URL or Binary Data.
Secondary Audio Source URL URL of the secondary audio source to mix in (used if Secondary Audio Source Type is URL).
Secondary Audio Source Binary Property Name of the binary property containing the secondary audio source data (used if Secondary Audio Source Type is Binary Data).
Primary Source Volume Volume level for the primary source, from 0 (mute) to 10 (max). Default is 1.0 (original volume).
Secondary Audio Volume Volume level for the secondary audio source, from 0 (mute) to 10 (max). Default is 1.0 (original volume).
Enable Partial Mix Boolean to enable partial mixing, allowing insertion of the secondary audio at a specific time range instead of mixing full length.
Output Length (Full Mix) When partial mix is disabled, determines output length: Shortest (ends when shortest source ends), Longest (ends when longest source ends), or From Primary Source (matches primary source length).
Start Time (seconds) Start time in seconds where the secondary audio will be inserted during partial mixing. Required if partial mix is enabled.
Mix Duration (seconds) Duration in seconds for how long the secondary audio should play during partial mixing. If empty, uses full length of secondary audio.
Loop Audio if Shorter If true and secondary audio is shorter than Mix Duration, loops the secondary audio to fill duration; if false, inserts as-is and may end early. Always trims if longer than duration.
Enable Fade In Enables fade-in effect on the secondary audio at the start of its playback.
Fade In Duration (seconds) Duration in seconds of the fade-in effect applied to the secondary audio.
Enable Fade Out Enables fade-out effect on the secondary audio at the end of its playback.
Fade Out Duration (seconds) Duration in seconds of the fade-out effect applied to the secondary audio.

Output

The node outputs a single item per input with the following structure:

  • json: An empty object {} indicating no JSON metadata is returned for this operation.
  • binary.data: Contains the mixed audio file as binary data, ready for further use or saving.
  • pairedItem.item: The index of the input item this output corresponds to.

The binary data represents the resulting audio after mixing the primary and secondary sources according to the specified parameters.

Dependencies

  • Requires FFmpeg installed and accessible in the environment where n8n runs, as all media processing relies on FFmpeg commands.
  • Supports input sources as URLs or binary data, so network access or prior binary data preparation is necessary.
  • No external API keys or services are required beyond local FFmpeg availability.

Troubleshooting

  • No binary data found in property: Ensure that the binary property name specified matches the actual binary data property in the input item.
  • Source file not found or inaccessible: Verify URLs are correct and reachable or that binary data is properly provided.
  • FFmpeg errors: Check that FFmpeg is installed and compatible with the node's requirements.
  • Output missing: If the operation does not produce output, verify all required parameters are set correctly, especially when enabling partial mix or fade effects.
  • Volume settings too high: Setting volume above normal ranges may cause distortion; keep values reasonable.
  • Looping issues: When looping is enabled, ensure the duration is set appropriately to avoid unexpected audio length.

Links and References

Discussion