# Cut a Video into Segments

Cut a video to multiple time windows, keep or remove those clips, and export one joined MP4. Runs locally in your browser.

## Run it

- **CLI:** `gizza tool video-cut-segments 'url=https://example.com/input' 'segments=0:05-0:10
1:30-1:45' 'mode=keep'`
- **Web:** https://gizza.ai/tools/video-cut-segments/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/video-cut-segments/tool.json

## Inputs

- `file` — Video _(file; accept: video/*)_
- `segments` — Time windows (start-end per line, or comma-separated) _(field)_
- `mode` — Mode _(field)_

## Output

- Cut video (video)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `segments` — Time windows (start-end per line, or comma-separated)
- `mode` — Mode
- `url` — fetch the input file from a public URL (CORS-permitting)

Example: `https://gizza.ai/tools/video-cut-segments/?url=https://example.com/input&segments=0%3A05-0%3A10%0A1%3A30-1%3A45&mode=keep`

---

## About this tool

**video-cut-segments** trims a single video down to the exact parts you want. Type a
list of `start-end` time windows and pick a mode:

- **Keep** extracts only the windows you listed and joins them into one clip, in the
  order they appear in the source — a fast way to build a highlight reel or drop the
  boring bits between the good takes.
- **Remove** cuts the listed windows out and keeps everything else — the classic
  "delete the middle" edit, an intro trim, or pulling a few mistakes out of a screen
  recording.

Each time can be written as `SS`, `MM:SS`, or `HH:MM:SS`, and fractions of a second
work too (`0:03.5`). Separate windows with a new line, a comma, or a semicolon.
Overlapping or touching windows are merged automatically, so a frame is never
duplicated. Audio stays in sync — the tool trims and re-joins the video and audio
tracks together (`trim`/`atrim` + `concat`), which is more reliable across multiple
sections than the bare `select` filter. The result is a single re-encoded H.264/AAC
`.mp4`.

Everything runs locally in your browser with ffmpeg (WebAssembly). Your video is
never uploaded to a server. For a single continuous clip with no re-encode, use the
**video-trim** tool instead; to auto-drop silent gaps, see **video-silence-cut**.

## FAQ

<!-- FAQ MUST be <details>/<summary> accordions: site/tool.css styles them and
     scripts/check-tool-hygiene.py fails the build on a plain-markdown FAQ. Keep
     the blank line inside each <details> so the answer's markdown renders. -->

<details>
<summary>How do I write the time windows?</summary>

Each window is `start-end`, and you list one or more of them. Times can be `SS`
(seconds), `MM:SS`, or `HH:MM:SS`, with optional fractions — for example
`5-10`, `0:05-0:10`, or `1:02:03-1:02:30`. Put each window on its own line, or
separate them with commas or semicolons: `0:05-0:10, 1:30-1:45`.

</details>

<details>
<summary>What's the difference between keep and remove?</summary>

**Keep** produces a clip containing only the windows you listed, joined together —
everything else is discarded. **Remove** does the opposite: it deletes the listed
windows and keeps all the footage around them. Both run in a single pass and join
into one output file.

</details>

<details>
<summary>Will the audio stay in sync?</summary>

Yes. The video and audio tracks are trimmed and re-joined together for every
window (`trim`/`atrim` + `setpts`/`asetpts` + `concat`), which keeps them aligned
across multiple cuts. This is why the output is re-encoded rather than a
stream-copy — a frame-accurate multi-segment join can't be done losslessly.

</details>

<details>
<summary>Is my video uploaded anywhere?</summary>

No. The cut runs entirely in your browser with ffmpeg compiled to WebAssembly.
The file never leaves your device, so it works offline and keeps private footage
private.

</details>

<details>
<summary>What if my windows overlap?</summary>

Overlapping or back-to-back windows are merged before cutting, so the same frame
is never selected twice (in keep mode) or double-counted (in remove mode). The
windows are also sorted by start time, so you don't have to list them in order.

</details>

## Related tools

- [Change Video Speed](https://gizza.ai/tools/change-speed/): Speed up or slow down a video right in your browser, keeping audio in sync — pick a speed factor (0.25x–4x). Re-encodes locally with ffmpeg, nothing is uploaded, free.
- [Extract Video Frames to a Contact Sheet](https://gizza.ai/tools/extract-frames/): Sample frames from a video by interval, fps or scene change and tile them into one contact-sheet image. Free, in your browser with ffmpeg, nothing is uploaded.
- [GIF to MP4 / WebM](https://gizza.ai/tools/gif-to-mp4/): Convert an animated GIF into a much smaller MP4 or WebM video, right in your browser. Re-encodes locally with ffmpeg (H.264 / VP9), nothing is uploaded, free.
- [Pad a Video to an Aspect Ratio](https://gizza.ai/tools/video-aspect-pad/): Letterbox or pillarbox a video to 9:16, 1:1, 16:9 or any preset ratio with colored bars or a blurred background — free, in your browser, nothing is uploaded.
- [Blur or Pixelate a Region in a Video](https://gizza.ai/tools/video-blur-region/): Blur or pixelate a fixed rectangle — a license plate, name tag or logo — on every frame of a video, right in your browser. Nothing is uploaded, runs locally, free.
