Frame-Accurate Video Cutting with FFmpeg

Cutting videos with frame-level precision in FFmpeg requires understanding the difference between fast seeking (input seeking) and accurate seeking (output seeking). This guide explains how to combine seeking parameters and re-encoding to split or cut videos at exact frames, avoiding frozen frames, black screens, or audio desync at the cut points.

Understanding the Keyframe Limitation

To cut a video with frame accuracy, you must understand how video compression works. Videos are made of keyframes (I-frames), which contain a complete image, and inter-frames (P-frames and B-frames), which only store the differences between frames.

If you cut a video using the stream copy mode (-c copy), FFmpeg can only cut at the nearest keyframe. If your specified cut time falls on a P-frame or B-frame, the video will start with a frozen or black screen until the next keyframe is reached.

To achieve true frame-accuracy, you must re-encode the video. Re-encoding allows FFmpeg to generate a new keyframe at the exact timestamp you specify.


This is the most reliable method for cutting a video at an exact frame. By placing the seek parameter (-ss) before the input, FFmpeg quickly seeks to the closest keyframe before your target time, and then decodes the remaining frames up to your start point. By re-encoding, it creates a clean new keyframe at the cut.

The Command:

ffmpeg -ss 00:01:30 -i input.mp4 -to 00:02:15 -c:v libx264 -c:a aac output.mp4

Parameter Breakdown:


Method 2: Fast seeking with “Smart Cut” (Experimental)

If you have a very long video and do not want to re-encode the entire output, you can use a hybrid approach. This seeks quickly to the nearest keyframe, copies the majority of the video stream, but re-encodes only the frames at the cut point.

While FFmpeg does not have a native “smart cut” flag, you can achieve a similar result by splitting the process: 1. Re-encode only the small segment from your cut point to the next keyframe. 2. Copy the middle section without re-encoding. 3. Concatenate the segments back together.

For most users, Method 1 is highly recommended because modern CPUs can re-encode short video clips quickly, ensuring 100% compatibility and eliminating audio/video sync issues.


Key Best Practices