FFmpeg Scene Cut Detection: Purpose and How to Disable

This article explains the purpose of scene cut detection in FFmpeg, why you might need to turn it off for specific video distribution workflows, and the exact command-line parameters required to disable it for popular video encoders like H.264 and H.265.

What is Scene Cut Detection in FFmpeg?

During video encoding, FFmpeg analyzes the visual differences between consecutive frames. If a sudden, dramatic change in the visual content occurs—such as a camera cut or a transition to a new location—FFmpeg identifies this as a “scene cut.”

By default, FFmpeg’s encoders (like libx264 and libx265) will automatically insert a keyframe (I-frame) at the exact moment of a scene cut, regardless of the set keyframe interval (GOP size). Keyframes contain the complete visual data for a frame, which ensures that a newly introduced scene looks sharp and free of compression artifacts.

Why Disable Scene Cut Detection?

While scene cut detection improves visual quality and compression efficiency for standard playback, it creates issues for adaptive bitrate streaming protocols like HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH).

For HLS and DASH to work smoothly, the video must be split into segments of exact, identical durations (e.g., exactly 2-second or 6-second chunks) across all bitrate variants. If scene cut detection is enabled, the encoder inserts extra keyframes at unpredictable intervals. This forces segments to split at irregular times, leading to mismatched segment boundaries between different quality levels. Disabling scene cut detection enforces a strict, predictable keyframe interval (closed GOP structure), ensuring seamless quality switching for the viewer.

How to Disable Scene Cut Detection

To disable scene cut detection, you must configure the encoder to ignore visual changes and strictly adhere to your specified keyframe interval. Below are the commands for the most common encoders.

Disabling Scene Cut in H.264 (libx264)

For the standard H.264 encoder, you must set the scene cut threshold (-sc_threshold) to 0. You should also set the minimum keyframe interval (-keyint_min) and the maximum keyframe interval (-g) to the same value to force a fixed GOP size.

ffmpeg -i input.mp4 -c:v libx264 -g 60 -keyint_min 60 -sc_threshold 0 output.mp4

Alternatively, you can pass this constraint directly to the encoder library using the -x264-params flag:

ffmpeg -i input.mp4 -c:v libx264 -g 60 -keyint_min 60 -x264-params scenecut=0 output.mp4

Disabling Scene Cut in H.265 (libx265)

For the HEVC/H.265 encoder, the scene cut detection is disabled by passing the no-scenecut=1 argument inside the -x265-params flag.

ffmpeg -i input.mp4 -c:v libx265 -g 60 -keyint_min 60 -x265-params no-scenecut=1 output.mp4

By applying these settings, FFmpeg will ignore visual transitions and only place keyframes at the exact interval defined by your -g parameter, resulting in perfectly aligned segments suitable for modern streaming networks.