MediaFX icon

MediaFX

Process videos, audio, and media files with FFmpeg

Actions15

Overview

The node provides a "Stamp Image" operation under the "Image" resource that allows users to overlay (stamp) an image onto a video. This is useful for watermarking videos, adding logos, or placing any custom graphic on top of a video stream.

Typical use cases include:

  • Adding branding logos or watermarks to marketing videos.
  • Overlaying timestamps or icons on surveillance footage.
  • Placing decorative or informative images on video content dynamically.

For example, you can stamp a company logo PNG onto a promotional video at the bottom-right corner with partial transparency and control when the stamp appears during playback.

Properties

Name Meaning
Source Video The input video to which the image will be stamped. Can be provided as a URL or binary data.
Stamp Image The image to overlay on the video. Can be provided as a URL or binary data.
Width (pixels) Width of the stamp image in pixels. Use -1 to keep the original aspect ratio.
Height (pixels) Height of the stamp image in pixels. Use -1 to keep the original aspect ratio.
Position X Horizontal position of the stamp from the left edge. Supports expressions like '10' (pixels) or '(main_w-overlay_w)-10' for right alignment.
Position Y Vertical position of the stamp from the top edge. Supports expressions like '10' (pixels) or '(main_h-overlay_h)-10' for bottom alignment.
Rotation (degrees) Clockwise rotation angle of the stamp image in degrees.
Enable Time Control Boolean flag to enable controlling when the stamp appears and disappears during the video timeline.
Start Time (seconds) When the stamp should start appearing in the video timeline (only if time control is enabled).
End Time (seconds) When the stamp should stop appearing. Leave empty to show for the entire video duration (only if time control is enabled).
Opacity Opacity level of the stamp image, from 0.0 (fully transparent) to 1.0 (fully opaque).

Output

The node outputs the processed video file with the stamp image applied. The output is provided as binary data attached to the data binary property of the output item.

  • json: An empty object {} since the main result is binary video data.
  • binary.data: Contains the stamped video file ready for further processing or saving.

Dependencies

  • Requires FFmpeg installed and accessible in the environment where n8n runs, as the stamping operation uses FFmpeg commands internally.
  • No external API keys or services are required; all processing is local.
  • Uses internal helper utilities for handling input sources (URL or binary), temporary files, and cleanup.

Troubleshooting

  • No binary data found: If using binary input for video or stamp image, ensure the specified binary property exists and contains valid data.
  • File not found errors: When providing local file paths (if applicable), verify the path is correct and accessible by n8n.
  • FFmpeg errors: Ensure FFmpeg is installed and compatible with the features used (e.g., overlay filters).
  • Incorrect positioning or sizing: Double-check expressions for x and y positions and width/height values. Using -1 for width or height preserves aspect ratio.
  • Opacity issues: Values must be between 0 and 1; values outside this range may cause unexpected results.
  • Time control not working: Make sure Enable Time Control is set to true to use start and end times.

If the node fails and Continue On Fail is disabled, it will throw an error stopping execution. Enabling Continue On Fail allows processing other items despite errors.

Links and References

Discussion