How to Trim or Cut a Video with FFmpeg Without Re-encoding: Exact Commands, Tested
FFmpeg commands to trim a video from one time to another, cut out a middle section, or crop, without re-encoding where possible. Measured on a Mac.
On this page
To trim a video with FFmpeg without re-encoding, put the start time before the input and tell FFmpeg to copy the streams:
ffmpeg -ss 00:01:00 -to 00:01:20 -i input.mp4 -c copy clip.mp4
That cuts from 1:00 to 1:20 in a fraction of a second, because FFmpeg moves the compressed video and audio into a new file instead of decoding and encoding them again. The catch is that a copied cut can only begin cleanly on a keyframe, and what happens when your start time isn’t on one depends on the container and the player.
This guide gives the commands for cutting from one time to another, removing a part from the middle, and cropping, explains each flag from FFmpeg’s own documentation, and shows what I measured when I ran them on a Mac. If you’d rather understand the theory first, our explainer on why lossless cuts snap to keyframes covers it.
Before you start: only trim video you have the right to use: your own recordings, material under a licence that allows it, or footage you have permission to edit.
Key takeaways:
- The command:
ffmpeg -ss START -to END -i input.mp4 -c copy clip.mp4. On a 2-minute 720p test file it ran in 0.02 s; a re-encode of the same cut took 1.2 s. - Copied cuts start on a keyframe. Asking for 1:01 when the keyframe was at 1:00 gave an MP4 that hides the extra second behind an edit list, and an MKV that plays it.
-ssafter-iwith-c copyleft the video starting 1.0 s after the audio in my test.- To cut out part of a video, make two copied cuts and join them with the concat demuxer: 89.107 s against the 89 s expected.
- Cropping needs a re-encode (4.3 s for 2 minutes of 720p), but the audio can still be copied byte for byte.
How I tested this
Numbers in this guide come from a test file I generated, so you can reproduce them:
- Tool: FFmpeg 8.1.2, installed with Homebrew, on a MacBook Air with an Apple M4 chip running macOS 26.
- Source file: a 120-second, 1280×720, 24 fps H.264 and AAC MP4 (43.7 MB). I encoded it with a keyframe exactly every 4 seconds, and burned a running timecode into every frame, so I could read the real start time off the first picture of each clip.
- Players used for checking: FFmpeg itself, and Apple’s AVFoundation framework (the media framework macOS apps are built on), which I used to pull the first frame of each clip.
For the middle-cut and crop tests I made a file with the same specs and keyframe spacing, and matched each output frame to the source by checksum instead of reading a timecode.
Your own files will behave the same way in principle, but the exact offsets depend on where your keyframes are. Keyframe spacing differs from file to file, and FFmpeg can show you where yours are (see “Find your keyframes” below).
Install FFmpeg with Homebrew:
brew install ffmpeg
The commands
Cut a video from one time to another
ffmpeg -ss 00:01:00 -to 00:01:20 -i input.mp4 -c copy clip.mp4
| Part | What it does |
|---|---|
-ss 00:01:00 |
Start at 1 minute. Placed before -i, it’s an input option: FFmpeg seeks in the source. |
-to 00:01:20 |
Stop at 1 minute 20 seconds of the source. |
-i input.mp4 |
The file to read. |
-c copy |
Copy every stream as it is. No decoding, no encoding. |
clip.mp4 |
The new file. |
You can use seconds (-ss 60), HH:MM:SS, or fractions (-ss 00:01:00.5).
Cut a start time plus a length
ffmpeg -ss 00:01:00 -i input.mp4 -t 20 -c copy clip.mp4
-t is a duration. The documentation says -to and -t are mutually exclusive, and if you give both, -t wins. Pick one.
Keep every audio track (or subtitle track)
By default FFmpeg picks one video stream and one audio stream. I made a test file with two audio tracks and trimmed it:
ffmpeg -ss 4 -to 20 -i two-audio.mp4 -c copy default.mp4 # 1 audio track out
ffmpeg -ss 4 -to 20 -i two-audio.mp4 -map 0 -c copy all.mp4 # 2 audio tracks out
The first dropped the second track. -map 0 kept both.
Why -ss goes before -i
FFmpeg’s documentation describes two behaviours for -ss:
- Before
-i(input option): FFmpeg seeks in the input. Most formats can’t seek to an exact position, so it goes to the nearest seek point before the time you gave. - After
-i(output option): FFmpeg decodes and throws away the input until it reaches your time.
Decoding is exactly what -c copy avoids, so for stream copy the input position is the one to use. I tested the other order to see what actually happens, with the source’s keyframes at 56 and 60 seconds:
ffmpeg -i input.mp4 -ss 00:00:59 -t 20 -c copy wrong-order.mp4
The result played, but its video stream started 1.0 second after its audio. The audio began at the 59-second mark you asked for, while the video could only start at the next keyframe, at 60 seconds. Run the same cut with -ss before -i and the two streams line up. With -c copy, keep -ss ahead of the input.
What a copied cut does to your start point
Here’s the test that matters. I asked for 61 to 81 seconds. The source’s keyframes are at 60 and 64, so 61 is not on one.
ffmpeg -ss 61 -to 81 -i input.mp4 -c copy clip.mp4
| Run | Duration | Size | First visible frame | Time taken |
|---|---|---|---|---|
| Stream copy, MP4 output | 20.125 s | 7.7 MB | 1:01.000 in Apple’s AVFoundation | 0.02 s |
Same file, read with FFmpeg’s -ignore_editlist 1 |
n/a | n/a | 1:00.000 | n/a |
| Stream copy, MKV output | 21.221 s | n/a | 1:00.000 | n/a |
Re-encoded (-c:v libx264 -crf 18 -c:a aac) |
20.000 s | 9.4 MB | 1:01.000 | 1.2 s (about 9.5 s of CPU) |
Three things to read from this.
1. The MP4 starts where you asked, but it carries extra frames. FFmpeg can’t start a copied stream mid-group, so it writes the keyframe from 60 seconds into the file, and then adds a note to the MP4 (an edit list) telling players to skip the first second. A player that follows the edit list, as Apple’s framework did here, shows 1:01.000. The file’s first packet is stamped −1.0 s, which is where that skipped second lives.
2. Not every reader honours that note. When I told FFmpeg to ignore the edit list, the first picture was 1:00.000, a full second before the request. The MKV output, read back with FFmpeg, also began at 1:00.000 and ran 21.2 seconds. If your clip is going to a tool you can’t test first, assume it may start at the previous keyframe.
3. The cost of exactness is a re-encode. The re-encoded clip started at exactly 1:01 and was 20.000 seconds long, but it took about 60 times longer (1.2 s against 0.02 s) and the video went through a second round of lossy compression. FFmpeg’s documentation says that, with stream copy, there is no decoding or encoding, so it is very fast and there is no quality loss, and that filters can’t be applied because they work on decoded frames. I checked that last point: adding a crop filter to a -c copy command stops with the error “Filtering and streamcopy cannot be used together.”
This is what I measured for FFmpeg’s own MP4 and MKV output on this file. It doesn’t tell you what any other app does. VidNeat, for example, documents that its cuts are snapped back to the nearest keyframe and reports where each one landed. See the stream-copy trimming runbook.
Find your keyframes
Before you pick a start time, you can list where your file’s keyframes are:
ffprobe -v error -select_streams v -skip_frame nokey \
-show_entries frame=pts_time -of csv=p=0 input.mp4
On my test file this printed 0.000000, 4.000000, 8.000000, 12.000000…, one line per keyframe. Choose a start time on one of those lines and a copied cut begins exactly there, with no ambiguity about edit lists. In my run, a start of exactly 1:00 (a keyframe) with an end of 1:20 produced a clip that was 20.083 seconds long, with no hidden lead-in.
To check the clip you just made:
ffprobe -v error -show_entries format=duration,size -of csv=p=0 clip.mp4
How to cut out part of a video with FFmpeg
FFmpeg has no single “delete this range” option that works with stream copy. Cut the part before and the part after, then join them. To remove 0:30 to 1:01:
ffmpeg -i input.mp4 -to 30 -c copy part1.mp4
ffmpeg -ss 61 -i input.mp4 -c copy part2.mp4
printf "file 'part1.mp4'\nfile 'part2.mp4'\n" > list.txt
ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4
The last command uses FFmpeg’s concat demuxer, which joins the files listed in list.txt. I ran this on the test file, where 1:01 is not a keyframe (they’re at 1:00 and 1:04), and compared each output frame with the source by checksum:
| Method | Duration (89 s expected) | Where part 2 picks up |
|---|---|---|
| MP4 parts + concat demuxer (above) | 89.107 s | 1:00.958, within a frame of 1:01, in FFmpeg |
| MPEG-TS parts + concat protocol | 90.107 s | 1:00.000, a second of the removed part comes back |
Re-encoded with a select filter |
88.979 s | 1:01 |
The MP4 route is the closest, with a catch. FFmpeg showed the join within a frame of the times I asked for, and the audio had no gap at the join. But the file still carries the lead-in from the 1:00 keyframe: it holds 2,162 video packets, while FFmpeg displays 2,139 frames. A player that doesn’t skip those packets could show up to a second of the part you removed, the same caveat as the edit list above.
The TS route keeps the lead-in in plain sight. MPEG-TS has no way to mark frames as hidden, so the whole second from 1:00 to 1:01 played back. The concat protocol is still the right tool for joining .ts segments from one stream into an MP4, where no cut is involved, but not for this job.
For an exact cut, re-encode, or start part 2 on a keyframe. Pick the time for -ss from the ffprobe list above and the copy method is exact. Otherwise, drop the range with filters:
ffmpeg -i input.mp4 \
-vf "select='not(between(t,30,61))',setpts=N/FRAME_RATE/TB" \
-af "aselect='not(between(t,30,61))',asetpts=N/SR/TB" \
-c:v libx264 -crf 18 -c:a aac output.mp4
select keeps the frames outside 0:30–1:01, and setpts closes the gap they leave. On the 2-minute test file this took 5.9 seconds, against a fraction of a second for the copy methods.
Can FFmpeg crop a video without re-encoding?
In practice, no. Cropping changes which pixels are in each frame, so it’s a filter, and filters need decoded frames. With -c copy, FFmpeg stops with the “Filtering and streamcopy cannot be used together” error shown earlier. Re-encode the video, but copy the audio:
ffmpeg -i input.mp4 -vf crop=720:720:280:0 -c:v libx264 -crf 18 -preset fast -c:a copy cropped.mp4
crop=720:720:280:0 keeps a 720×720 area starting 280 pixels from the left and 0 from the top (width:height:x:y). On the 1280×720 test file this took 4.3 seconds for 2 minutes of video, and the audio track came out byte-for-byte identical to the source.
There is one partial exception. H.264 and HEVC streams store a cropping window in their headers, and FFmpeg’s h264_metadata bitstream filter (hevc_metadata for HEVC) can change it without touching the picture data:
ffmpeg -i input.mp4 -c copy -bsf:v h264_metadata=crop_left=280:crop_right=280 cropped.mp4
It finished instantly, and FFmpeg decoded the result at 720×720. But macOS Quick Look still drew a 1280×720 thumbnail of the same file, so not every player honours the window. Use even numbers, and use this only if you can test the player that will show the video.
Which approach should you use?
| You need | Use | Trade-off |
|---|---|---|
| The original quality, fast, and a small timing error is fine | -ss before -i with -c copy |
The cut starts at a keyframe, or relies on the player honouring an edit list |
| An exact frame at the start | Re-encode the clip | Slower, and a second generation of lossy compression |
| An exact start without re-encoding the whole clip | Pick a keyframe time from ffprobe |
You can’t choose any time you like |
| Remove a section from the middle | Two copied cuts joined with the concat demuxer | Part 2 starts on a keyframe unless you re-encode |
| A crop, scale, or any filter | Re-encode, with -c:a copy for the audio |
Filters can’t run on copied streams |
If you want a graphical front end that shows the last FFmpeg command it ran, the open-source LosslessCut does that, and we’ve written about using LosslessCut on a Mac.
Common questions
How do I trim a video with FFmpeg?
Run ffmpeg -ss 00:01:00 -to 00:01:20 -i input.mp4 -c copy clip.mp4, replacing the two times with your start and end. It keeps the original quality and finishes almost instantly because nothing is re-encoded.
Is an FFmpeg trim frame-accurate?
Only if you re-encode, or if your start time is on a keyframe. A copied cut begins at the keyframe before your start, so list the keyframes with ffprobe (above) and pick one of those times.
Does -c copy lose quality?
No. FFmpeg’s documentation says stream copy passes packets through without decoding or encoding. The video in the output is the same compressed data as the source.
Why is my trimmed clip a second or two too long?
The copied cut had to begin on a keyframe before your start time. Either the player is showing that extra lead-in, or the clip carries it as hidden frames behind an edit list, as in the test above.
Why did my audio and video drift apart?
A common cause is -ss placed after -i together with -c copy. In my test it left the video starting 1.0 s after the audio. Move -ss before -i.
Can I trim a video I haven’t downloaded yet?
That’s a different job from cutting a file you already have. For a link, our guide to clipping YouTube videos on a Mac compares the options, including setting the range before you download. VidNeat is our app, and it only works from links, not local files.
Summary
- The command:
ffmpeg -ss START -to END -i input.mp4 -c copy clip.mp4. - Keep
-ssbefore-iwhen you use-c copy, or the streams can start at different times. - A copied cut starts on a keyframe. Use
ffprobeto list them, or accept a lead-in of up to one keyframe interval. - To cut out the middle, copy the part before and the part after, then join them with the concat demuxer.
- Re-encode only when you need an exact frame or a filter, such as a crop. You can still copy the audio.
- Add
-map 0if the file has more than one audio or subtitle track.
Related guides
Lossless Video Trimming: Why Cuts Snap to Keyframes (and When to Re-encode)
Lossless video trimming copies streams instead of re-encoding, so the cut must start on a keyframe. Why, what it costs, and when re-encoding is right.
How to Clip YouTube Videos on Mac: 3 Ways to Get a Link or an MP4 File
YouTube's Clip button only makes a link. Here's how to clip a YouTube video on a Mac as a link or as an MP4 file you can edit, and the limits of each method.
Stream-copy trimming
How VidNeat cuts a clip by copying streams, and where that cut lands.
Combine .ts segments into one MP4
Four FFmpeg joining methods measured on the same files, and the one that adds gaps.
Get the clip you need. Not the entire video.
A native Mac downloader that fetches the range you mark and cuts by copying streams. Requires macOS 14.0 Sonoma or later.
VidNeat is a software tool. You are responsible for having the rights or permission to access, use, edit and export the media you work with.