Actions7
Overview
The ClipMagic node integrates with the ClipMagic API to perform various video and audio processing tasks. Specifically, the "Trim Media" operation allows users to trim segments from a media file (video or audio) by specifying start and end times or durations. This is useful for extracting highlights, removing unwanted sections, or creating clips from longer media files.
Common scenarios include:
- Creating short clips from a longer video for social media sharing.
- Extracting specific audio segments from podcasts or interviews.
- Preparing multiple trimmed segments from a single media source in one operation.
For example, you can input a URL of a video and specify a start time of 00:01:00 and a duration of 30 seconds to get a 30-second clip starting at one minute into the video.
Properties
| Name | Meaning |
|---|---|
| Media URL | Input media URL to trim (required). Can be a direct file URL or a share link. |
| Trim Mode | Choose between trimming a single segment or multiple segments. Options: Single Segment, Multiple Segments. |
| Start Time | (Single segment only) Start time of the clip in HH:MM:SS format or seconds. |
| End Mode | (Single segment only) Defines how the end of the clip is specified: by End Time or Duration. |
| End Time | (Single segment + End Mode = End Time) End time of the clip in HH:MM:SS format. |
| Duration | (Single segment + End Mode = Duration) Length of the clip in seconds or HH:MM:SS format. |
| Segments | (Multiple segments only) Collection of segments to trim, each with its own Start, End Mode, End Time or Duration. |
| Output Format | Target format for the trimmed clips. Options: MP4, GIF, MOV, MP3, WAV. |
| Output Filename | Optional custom filename for the output file (without extension). |
| Options > Timeout (ms) | How long to wait before aborting the HTTP call. Set to 0 for no limit. Default is 600000 ms (10 minutes). |
Output
The node outputs JSON data and binary data:
JSON output includes:
success: Boolean indicating if the operation succeeded.operation: The operation performed ("trim").filename: The name of the output file.contentType: MIME type of the output media.- Additional response fields from the API if the output is JSON instead of media.
Binary output contains the trimmed media file under the key
data. This binary data represents the trimmed video or audio clip in the selected output format.
Dependencies
- Requires an API key credential for authenticating with the ClipMagic API.
- The node makes HTTP requests to the ClipMagic service endpoint.
- No additional environment variables are required beyond the API credential.
Troubleshooting
- Timeouts: If trimming large files or multiple segments, the default timeout (10 minutes) might be insufficient. Increase the timeout option accordingly.
- Invalid time formats: Ensure start, end, and duration values are correctly formatted as HH:MM:SS or seconds.
- Unsupported media URLs: The input URL must be accessible and supported by the ClipMagic API.
- API errors: Errors returned by the API will appear in the JSON output under
errorwhensuccessis false. - Filename issues: If the output filename is not set, the node attempts to extract it from the API response headers; otherwise, a default name is used.
Links and References
- ClipMagic API Documentation (hypothetical link)
- n8n Documentation on Creating Custom Nodes