How to Trim a Video to a Specific Length
Enter a source video, start time, and duration to extract a shorter section. A successful operation returns non-empty MP4 data encoded as Base64 text.
A focused way to shorten a video
Trim Video helps you turn a longer source into a shorter MP4 clip by choosing where extraction begins and how long it continues. This is useful for isolating a scene, removing unwanted material around a section, or preparing a defined segment for a task that accepts MP4 video. The media input must be non-empty data representing a video that the tool can process. You provide that media as Base64 text, then specify timing values in seconds. The result follows the selected timing after the tool applies its supported ranges.
Steps for setting the clip
-
Provide the source media. Supply non-empty Base64 text representing the video. When you provide the media directly, keep the input at or below 50 MB. A directly supplied input larger than that boundary is rejected, so check the size before submitting rather than treating the boundary as a general rule for every possible path.
-
Choose the starting point. Enter the number of seconds from the beginning of the source where the clip should start. Leaving this value out uses 0 seconds. The accepted timing range is 0 through 86,400 seconds; a value below 0 or above 86,400 is constrained to that range before the clip is extracted.
-
Choose the clip length. Enter the desired duration in seconds. If you do not provide one, the tool uses 10 seconds. Requested durations are constrained between 0.1 and 300 seconds, so a value outside those boundaries is adjusted to the supported range instead of being used unchanged.
-
Submit the operation. The tool extracts the section beginning at the processed start time and continuing for the processed duration. Processing requires an available FFmpeg runtime and can fail if the source cannot be processed, the operation times out, or no non-empty output file is produced.
-
Use the returned media. A successful operation provides a non-empty MP4 encoded as Base64 text. Pass that output to a destination that accepts an MP4 clip, or use it as the source for a later video task.
Reading the trimmed result
Read the result against the processed values, not only the numbers you originally entered. For instance, an out-of-range start time or duration may produce a clip based on the nearest supported boundary. If the opening image or final length seems unexpected, review both timing fields and check whether one was omitted, since omission activates a default rather than preserving an empty setting.
A successful response has two useful properties: it is an MP4, and its Base64 representation contains non-empty output data. The source format does not change that stated output shape. Timing alone does not establish that processing will succeed; the media must remain processable, and the operation may also fail because of a timeout or because it produces no non-empty output file.
For a 42-second source, a start time of 8 seconds and a duration of 12 seconds describe the section from the eighth second through the requested 12-second span. If processing succeeds, inspect the returned Base64 data as a non-empty MP4 rather than expecting the original file format to be preserved.
Worked example
You need a 12-second segment that begins 8 seconds into a 42-second source video.
Provide the 42-second source as Base64 media, enter 8 seconds for the start and 12 seconds for the duration, then submit the operation.
A successful operation returns non-empty MP4 output represented as Base64 text, corresponding to the selected section.
Limitations
- The 50 MB boundary applies to media supplied directly, not to every possible input or output path.
- A valid timing selection does not prevent failures caused by an unprocessable source, a timeout, or missing non-empty output.
Common errors
- A submission can fail when directly supplied media exceeds 50 MB or cannot be processed. Corrective action: use direct input within the stated boundary, verify that the source is processable, and submit again.
FAQ
What happens when the start time is missing or outside the supported range?
When the field is omitted, the operation starts at 0 seconds. A value outside 0 through 86,400 seconds is constrained to that supported range before extraction.
What duration is used when I leave the field empty?
Without a supplied duration, the operation uses 10 seconds. A requested value below 0.1 or above 300 seconds is constrained before processing.
What is the size boundary for directly supplied video?
For media supplied directly, an input larger than 50 MB is rejected. This stated boundary concerns direct media input and does not define every other possible path.
What does a successful trimmed-video result contain?
When processing succeeds, the returned media is non-empty MP4 output represented as Base64 text. Processing may still fail if the source is not processable, the operation times out, or no non-empty output file is produced.