FFmpeg · Command Guide

How to Trim a Video With FFmpeg Without Re-Encoding

Trimming with re-encoding is slow and loses a small amount of quality every time. Trimming on keyframes with stream copy is instant and lossless — the tradeoff is you can only cut on keyframe boundaries, not frame-exact.

Trimming with re-encoding is slow and loses a small amount of quality every time. Trimming on keyframes with stream copy is instant and lossless — the tradeoff is you can only cut on keyframe boundaries, not frame-exact.

The command

ffmpeg -ss 00:00:10 -i input.mp4 -to 00:00:25 -c copy output.mp4

What each flag does

-ss 00:00:10Seek to 10 seconds before reading input — placing it before -i makes this a fast keyframe seek.
-i input.mp4The source file.
-to 00:00:25End the output at the 25-second mark (not a duration — an absolute timestamp).
-c copyCopies both video and audio streams without re-encoding — this is what makes it instant.

Where this goes wrong

With -c copy, FFmpeg can only start the output on a keyframe, so your trim point can land up to a couple of seconds off from where you asked, snapping to the nearest keyframe before it. If you need a frame-exact cut, drop -c copy and let FFmpeg re-encode — slower, but exact.

Frame-exact trim (re-encoding)

ffmpeg -i input.mp4 -ss 00:00:10 -to 00:00:25 -c:v libx264 -crf 18 -c:a aac output.mp4

Here -ss is placed after -i, which forces FFmpeg to decode from the start and seek precisely, at the cost of speed. -crf 18 keeps quality close to visually lossless.

After the command

FFmpeg trims the clip. It doesn't add the caption, the zoom, or the callout on top of it — that's a separate step, and it's the one NULLFRAME's templates automate.

See the templates

Common questions

Why is my trimmed clip a few seconds longer than expected?+
That's the keyframe-snapping behavior of stream copy — the actual cut point moved to the nearest keyframe. Re-encode for an exact cut.
Can I trim without specifying an end time?+
Yes — use -t instead of -to to specify a duration from the start point instead of an absolute end timestamp.
Does trimming with -c copy work on any format?+
Mostly, but some containers (like certain .mov variants) handle stream copy trimming inconsistently — MP4 and MKV are the most reliable.