DevTools Logo

Video Trimmer

Video Trimmer

Choose in and out points on a timeline, snap to keyframes, and export an accurate local cut plan.

Runs in your browser

Source & timeline

no video

A plain browser cannot index real keyframes; the sample uses a known 5 s GOP.

Selection & export

no selection

Load a video or the sample to set in/out points and plan a cut.

Examples

Sparse keyframes

Input
in 10.4 s, out 25.8 s, 5 s GOP
Output
start 10.0 s (0.4 s snap), end 25.8 s, remux

Only the start needs keyframe alignment; the out point uses the last packet before the selection end.

Precise repro clip

Input
in 7.4 s, tolerance 1 s
Output
No snap → re-encode guidance

Snapping 2.4 s to the previous keyframe would change the clip too much, so accuracy wins.

Two clips

Input
Segments 1 and 2 in the list
Output
JSON plan with one command per segment

Segments are listed distinctly; overlapping ranges are allowed and are not merged.

About this tool

Video Trimmer turns a chosen time range into an explicit, reviewable cut plan. Numeric in/out fields and arrow-key nudges define the selection, and a timeline shows keyframe ticks next to the highlighted range. A synthesized 45-second sample with a known 5-second GOP makes the workflow explorable without granting file access.

The start is snapped backwards to the nearest keyframe within the chosen tolerance; that is what makes an MP4/MOV packet copy safe. The out point is deliberately not snapped forward: it is placed at the last packet at or before the requested end, so the clip never extends beyond what you selected. When the start is too far from a keyframe, the planner switches to re-encode guidance. DRM, audio-only and unsupported containers produce typed reasons rather than a silent degraded export.

Segments can be collected independently, each with its own path, estimated size and FFmpeg command. The complete plan downloads as JSON and the command for the first segment can be copied directly. This browser-only version plans cuts and never uploads video; actually rewriting frames happens locally when you run the command or use a WebCodecs-enabled encoder.

What this tool does not do

  • This browser-only version builds cut plans and commands; it does not remux or re-encode video frames itself.
  • Real keyframe positions require a container demuxer; the browser-only path uses an assumed GOP interval.
  • The out point is placed at the nearest packet boundary at or before the selection, so sub-frame precision depends on the source packet grid.
  • DRM-protected content and containers without a supported remux path are reported as unsupported.

How to use this tool

  1. Load a source

    Load the sample or choose a local video. A plain browser cannot index real keyframes, so an assumed GOP control is provided for real files.

  2. Set in/out points

    Type exact seconds, use arrow keys to nudge by one second (Shift for ten), or adjust the snap tolerance.

  3. Review the path

    Read the keyframe-exact / snapped badge, the chosen remux or re-encode path, the reason and the estimated output size.

  4. Collect and export

    Add segments, copy an FFmpeg command, then download the JSON cut plan for local execution.

Use cases

Creator highlights

Mark several highlights in a long recording and hand each one to a fast local packet copy.

Bug repro clips

Cut the exact seconds around a reproducible issue without uploading private screen recordings.

Delivery slicing

Plan multiple output clips with sensible filenames and size estimates before committing to an encode.

Path matrix

InputAligned range
MP4 / MOVPacket-copy remux, original quality preserved
WebMRe-encode guidance
MKVUnsupported: container cannot be remuxed here
DRM protectedUnsupported: decryption is out of scope

Selections shorter than 0.5 s are rejected; reversed handles are swapped and noted.

Common mistakes

Mistake:Expecting the out point to jump to the next keyframe.

Fix:The plan cuts at the last packet before the out point; only the start needs keyframe alignment for packet copy.

Mistake:Raising tolerance to hide a misaligned start.

Fix:A larger tolerance silently changes where the clip begins; keep it small and read the snap badge.

Mistake:Assuming the browser can index every keyframe.

Fix:Without a demuxer the tool uses an assumed GOP and labels it; verify boundaries before publishing.

Mistake:Treating the JSON as the finished video.

Fix:It is a cut plan with FFmpeg commands — run one locally to produce the actual file.

Frequently asked questions

Why does trimming snap to keyframes?

A packet copy can only start at a keyframe: later frames reference that keyframe for decoding. The planner moves the start backwards to the nearest keyframe within your tolerance and displays exactly how far it moved. Out points do not need a keyframe and are cut at the last packet before your selection.

Is the quality the same after trimming?

For an aligned MP4/MOV range the plan uses stream copy, so no frames are re-encoded and quality is unchanged. If the start is too far from a keyframe, the planner switches to re-encode guidance where quality depends on the chosen bitrate preset.

Does it work with MOV, WebM or MKV?

MOV follows the MP4 remux path. WebM is routed to re-encode guidance because VP9/opus ranges usually need fresh keyframes. MKV is reported as unsupported for browser remux with a typed reason and an FFmpeg fallback.

Can I cut multiple clips from one video?

Yes. Add each selection to the segment list — overlapping ranges are kept distinct. Every segment gets its own path badge and output name, and the JSON plan includes an FFmpeg command for each one.

Is my video uploaded?

No. The file stays in your browser tab. The tool plans cuts using metadata and the keyframe interval you supply; the exported JSON and commands are generated locally, and you run the actual cut on your own machine.

What does the browser know about real keyframes?

A plain browser exposes duration and dimensions but not the container's sample table. For real files the keyframe interval is an assumption you can adjust. The bundled sample has a known 5 s GOP so you can see the snapping behavior exactly.

References & standards