Actions13
- Video Actions
- Audio Actions
- Text Actions
- Image Actions
- Font Actions
Overview
This node, part of the "MediaFX" collection, allows users to add text overlays onto video files using FFmpeg. It supports specifying the source video either by URL or binary data and lets users customize the text content, timing, font, size, color, outline, and positioning. This is useful for adding subtitles, captions, watermarks, or any textual information directly onto videos.
Common scenarios:
- Adding subtitles or captions to a video clip.
- Watermarking videos with custom text.
- Highlighting specific moments in a video with timed text annotations.
- Creating promotional videos with branded text overlays.
Practical example:
You have a marketing video hosted online and want to add a call-to-action text that appears from 0 to 5 seconds, centered at the bottom, with a white font and slight outline for visibility. You provide the video URL as input, specify the text and timing, choose a font and size, and run this node to produce a new video file with the text embedded.
Properties
| Name | Meaning |
|---|---|
| Video Source | The input video to which text will be added. Can be provided as a URL or as binary data from previous nodes. |
| Text | The actual string content to display on the video. |
| Start Time (seconds) | The time in seconds when the text should start appearing on the video. |
| End Time (seconds) | The time in seconds when the text should stop appearing on the video. |
| Font Key | The font used for rendering the text. Options are dynamically loaded from available fonts, including user-uploaded fonts. |
| Font Size | The size of the text in pixels. |
| Color | The color of the text. Accepts named colors (e.g., "white", "red") or hex codes (e.g., "#FF0000"). |
| Outline Width | The width of the text border or outline, enhancing readability against varying backgrounds. |
| Position Type | How the text position is determined: either by preset alignment options or by custom X/Y coordinates using FFmpeg expressions. |
| Horizontal Alignment | When using alignment positioning, sets horizontal placement: Left, Center, or Right. |
| Vertical Alignment | When using alignment positioning, sets vertical placement: Top, Middle, or Bottom. |
| Horizontal Padding | Padding in pixels from the left/right edges when using alignment positioning. |
| Vertical Padding | Padding in pixels from the top/bottom edges when using alignment positioning. |
| Position X | Custom horizontal position expressed as an FFmpeg expression (e.g., "(w-text_w)/2" centers the text). Used only if Position Type is "Custom". |
| Position Y | Custom vertical position expressed as an FFmpeg expression (e.g., "h-th-50" places text 50 pixels above the bottom). Used only if Position Type is "Custom". |
Output
The node outputs a binary file containing the processed video with the text overlay applied. The output includes:
- json: An empty JSON object
{}indicating successful processing. - binary.data: The binary video file data ready for further use or download.
- pairedItem: Links the output to the corresponding input item index.
If the operation fails or no output is produced, an error message is returned in the JSON output instead.
Dependencies
- FFmpeg: The node relies on FFmpeg installed in the environment to process video files and apply text overlays.
- Fonts: Access to system or user-uploaded fonts is required to render text correctly.
- File System Access: Temporary files are created and cleaned up during processing.
- n8n Helpers: For handling binary data and temporary file management.
No special external API keys or credentials are needed specifically for this operation.
Troubleshooting
- No binary data found: If you select "Binary Data" as the video source but the specified binary property does not exist or is empty, the node will throw an error. Ensure the correct binary property name is provided and that the previous node outputs valid binary data.
- Font not found: Using a font key that does not exist or is not loaded may cause errors or fallback to default fonts. Verify font availability via the font selection dropdown.
- Invalid FFmpeg expressions: Custom X/Y positions must be valid FFmpeg expressions. Incorrect syntax can cause processing failures.
- File access issues: If providing a local file path for fonts or videos (in other operations), ensure the file exists and is accessible by n8n.
- Operation produces no output: If the node completes without producing a video file, it throws an error indicating no output was generated. Check input parameters and source validity.
To resolve most issues, verify inputs, check logs for detailed error messages, and ensure FFmpeg is properly installed and accessible.
