Why shot detectors miss dissolves

By ContentIndexer ·

Threshold-based shot detectors find hard cuts and miss dissolves, and changing the threshold doesn't fix it. We ran FFmpeg's scene filter and PySceneDetect's content and adaptive detectors at 12 settings between them, on a test reel with 4 hard cuts and on the same footage joined by 4 one-second cross-dissolves. Every setting found all 4 hard cuts with no false alarms. No setting found any of the 4 dissolves. The reason shows up in FFmpeg's own numbers: during a dissolve, the frame-to-frame change is no bigger than ordinary camera motion.

The test

We took five single-shot stock clips (from Pexels: an abstract particle animation, a forest walk, ocean waves, an aerial city skyline and a drone flight over a city). We cut 6 seconds from each and scaled everything to 1280×720 at 30 fps. Then we joined the clips two ways:

  • Hard-cut reel, 30 s: the five segments back to back, so there are 4 hard cuts, at 6, 12, 18 and 24 seconds.
  • Dissolve reel, 26 s: the same segments joined with FFmpeg's xfade=transition=fade:duration=1, so there are 4 one-second cross-dissolves.

A detection counts as a hit if it lands within one second of a real transition. Anything else is a false positive. We also ran every setting on the five original clips, where the right answer is no cuts at all.

The detectors are the three that ContentIndexer's pipeline runs, starting from the pipeline's own defaults (in bold below): FFmpeg 7.1 and PySceneDetect 0.6.4 with min_scene_len=15.

Results

Detector Setting Hard cuts found (of 4) Dissolves found (of 4) False positives
FFmpeg select='gt(scene,T)' T = 0.1, 0.2, 0.3, 0.4, 0.5 4 at every T 0 at every T 0
PySceneDetect ContentDetector threshold = 15, 21, 27, 35 4 at every setting 0 at every setting 0
PySceneDetect AdaptiveDetector adaptive_threshold = 1.5, 3, 5 4 at every setting 0 at every setting 0

False positives are counted across both reels and the five single-shot clips. That's zero for every setting, including on the drone flight and the moving skyline, the kind of camera motion that often trips a detector.

Why the dissolves disappear

FFmpeg gives every frame a scene score from 0 to 1, which measures how different it is from the frame before. The select filter keeps the frames that score above your threshold. Here is what those scores looked like:

Where in the reel Highest scene score
At the 4 hard cuts 0.892, 0.513, 0.757, 0.699
Anywhere else in the hard-cut reel (camera motion) 0.040
Inside the 4 dissolves 0.023, 0.040, 0.016, 0.016
Anywhere else in the dissolve reel 0.040

A hard cut changes the whole picture in one frame, so it scores 13 to 22 times higher than anything else in the reel. A one-second dissolve spreads the same change across 30 frames, and each step is tiny. The highest dissolve frame scored 0.040, and so did the camera motion in the middle of a shot. So a threshold low enough to catch the dissolves would catch the camera moves too. Every frame-difference detector has this problem, and both PySceneDetect detectors behaved the same way.

What to do about it

  • For hard cuts, the defaults are fine. On this footage, any FFmpeg threshold from 0.1 to 0.5 worked. The default of 0.3 leaves a wide margin on both sides. The weakest cut scored 0.513, and motion peaked at 0.040.
  • Don't tune the threshold to catch dissolves. The numbers above show it can't work: the dissolve peaks sit at or below the motion noise.
  • If your footage has dissolves or fades, use a detector built for gradual transitions. That means comparing frames further apart than one step, or a learned model trained on transitions such as TransNetV2. Then check it against footage you've labelled yourself.
  • Know which kind of footage you have. Interviews, screen recordings, sports and most YouTube edits are mostly hard cuts. Wedding films, trailers and slideshows lean on dissolves and fades, which threshold detectors will quietly miss.

Caveats. This is one small reel: 5 source clips and 4 transitions of each kind. All of it is clean, high-bitrate stock footage. Compressed or noisy video raises the motion floor, and faster dissolves (a few frames long) look more like cuts. The result is consistent across 12 settings and three detectors, but you should rerun the test on your own footage.

Reproduce it

Build the dissolve reel from any five clips of 6 seconds or more, at the same resolution and frame rate:

ffmpeg -i s0.mp4 -i s1.mp4 -i s2.mp4 -i s3.mp4 -i s4.mp4 -filter_complex \
  "[0:v][1:v]xfade=transition=fade:duration=1:offset=5[a];[a][2:v]xfade=transition=fade:duration=1:offset=10[b];\
   [b][3:v]xfade=transition=fade:duration=1:offset=15[c];[c][4:v]xfade=transition=fade:duration=1:offset=20[v]" \
  -map "[v]" dissolves.mp4

Print FFmpeg's scene score for every frame:

ffmpeg -i dissolves.mp4 -vf "select='gte(scene,0)',metadata=print" -f null - 2>&1 | grep scene_score

And run the pipeline's default detection:

ffmpeg -i dissolves.mp4 -vf "select='gt(scene,0.3)',showinfo" -f null - 2>&1 | grep showinfo

Shot detection in ContentIndexer

ContentIndexer's API runs FFmpeg shot detection with these defaults as the ffmpeg_shot_detection detector. It returns each shot's start and end as JSON, and can export them as an editor timeline (OTIO or FCPXML) or CSV. Now you know what it will catch and what it won't. Detector names and per-second pricing are in the API docs.