ForHosting KIT · Video

Trim video by timestamp

Check a cut before you make it: in a video of 01:42:30, a clip from 00:12:15.5 to 00:14:45.75 is valid and lasts 150.25 seconds, or 00:02:30.25. Reversed or out-of-range points are caught early. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

This trim video by timestamp calculator checks a proposed cut before you send it to an editor, transcoder, or media pipeline. Enter the full video duration, the point where the clip should begin, and the point where it should end. The result confirms that the range is valid and reports its exact duration in seconds and timestamp form.

Describe the source and cut with precise timestamps

Start with the total duration reported by your video player, probe, asset database, or editing application. Then enter the desired start and end timestamps. Each value may be written as a number of seconds, as MM:SS, or as HH:MM:SS.

Decimal fractions are accepted when frame-level or subsecond timing has already been converted to clock time. For example, 00:12:15.5 means twelve minutes and fifteen and one-half seconds. In a colon-form timestamp, the minutes and seconds components must each stay below sixty; hours may exceed twenty-three because this is elapsed media time, not a time of day.

All three values must be non-negative. This capability performs arithmetic on timestamps rather than frames, so it does not need a frame rate and does not guess whether a requested point falls on a keyframe. Use timestamps taken from the same source and time base to avoid mixing values measured against different versions of an asset.

Understand validation and the calculated duration

An end that precedes the start is rejected because it would produce a negative clip length. An end beyond the total duration is also rejected instead of being silently clamped, since automatic clamping can conceal stale metadata or a typing mistake. The start is checked against the source length as well, giving a clearer error when the whole requested range begins outside the video.

Equal start and end timestamps are accepted and produce a zero-second range; this can be useful for validating markers even though a downstream video editor may refuse to render an empty clip. On success, the response includes normalized numeric values for the source, start, end, and resulting clip, plus a zero-padded HH:MM:SS representation. The calculation is simply end minus start, performed deterministically without inspecting or modifying media bytes.

Use the result before editing or automation

Place this check immediately before the operation that cuts a video. A web form can validate timestamps as soon as a user submits them, while a batch workflow can reject invalid rows before starting expensive encoding jobs. Keep the returned seconds for tools that accept numeric offsets, and use the formatted clip duration in logs, review screens, or job summaries.

Because this capability does not receive the actual video, its answer depends on the total duration you provide; obtain that value from a trusted media probe when accuracy matters. Timestamp arithmetic also does not account for keyframe seeking, variable frame rate rounding, inclusive final frames, or an editor's own time-base rules. Those details belong to the later trimming tool.

The validator's narrower job is to establish that the requested interval is ordered, contained within the declared source, and mathematically well-defined.

Validate an editor form

Catch reversed or out-of-bounds timestamps before a user submits a video clipping job.

Preflight a batch manifest

Check every requested interval before spending compute time on a queue of encoding operations.

Calculate segment runtime

Turn review markers into an exact clip duration for schedules, logs, and downstream tools.

Does this capability trim or upload my video?

No. It validates timestamp values and calculates duration only; it never receives or modifies video bytes.

Which timestamp formats can I use?

Use seconds, MM:SS, or HH:MM:SS. Decimal fractions are supported for seconds.

Does it account for frames or keyframes?

No. It performs timestamp arithmetic only; the trimming or encoding tool decides how timestamps map to frames and keyframes.

What happens if the end is before the start or past the end of the video?

The range is rejected. A reversed range would give a negative length, and an end beyond the video is not silently shortened, because that could hide outdated information about the video or a typing mistake.

Can the end of the clip equal the full length of the video?

Yes. Both points only have to fall within the length you declared, so ending exactly at the last second is valid. Even an equal start and end is accepted as a zero-second range, useful for checking markers.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/video/trim-by-timestamp

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/video/trim-by-timestamp \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_duration":"01:42:30","start_timestamp":"00:12:15.5","end_timestamp":"00:14:45.75"}'
{
  "video_duration": "01:42:30",
  "start_timestamp": "00:12:15.5",
  "end_timestamp": "00:14:45.75"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "video.trim_by_timestamp",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb500
max_minutes60
max_megapixels3.9
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

It catches reversed ranges and endpoints beyond the source length early, without uploading, decoding, changing, or storing the video itself.

Understand validation and the calculated duration

The range is valid when the start is at or before the end and both endpoints fall within the declared video duration.

Use the result before editing or automation

Browser execution is available for interactive checks, while automated API requests cost $0.002 each.

What happens when the end is before the start?

The request returns an invalid_input error rather than reporting a negative duration.

Can the end timestamp equal the full video duration?

Yes. An endpoint exactly at the declared duration is within range.

What does an API request cost?

Each API request costs $0.002. The browser version can run locally for interactive checks.

Read the full KIT documentation →