Repository navigation
Release Notes
PySceneDetect 0.7.2 ships improved defaults for the histogram and perceptual hash detectors, adds PyAV 19 support, and fixes several timing and output bugs. Default output of detect-hist and detect-hash will change in this release due to improved default values.
CLI Changes
- [improvement]
HistogramDetector(detect-hist) defaultthresholdchanged from 0.05 to 0.20 and defaultbinsfrom 256 to 128, calibrated from the benchmarks. Output for this detector will change if you are not setting both parameters explicitly. #559- Use
detect-hist -t 0.05 -b 256orHistogramDetector(threshold=0.05, bins=256)to restore the previous behavior.
- Use
- [improvement]
HashDetector(detect-hash) defaultthresholdchanged from 0.395 to 0.35 and defaultsizefrom 16 to 8, calibrated from the benchmarks. Output for this detector will change if you are not setting both parameters explicitly. #559- Use
detect-hash -t 0.395 -s 16orHashDetector(threshold=0.395, size=16)to restore the previous behavior.
- Use
- [improvement]
detect-thresholdnow ignores fade-outs shorter than0.1sby default. Use--min-out-length 0to restore the previous behavior. The API default remains0#278 - [feature] Added
save-keyframescommand to export detected cuts using# keyframe format v1for Aegisub-compatible tools #534. Frame numbers are currently approximate for VFR input #569 - [feature] Add
--min-out-length/min_out_lengthtodetect-threshold/ThresholdDetector, which requires that fades stay below the threshold for the given duration #278 - [general]
-f,--frame-rate, and--framerateare now aliases of the same CLI option, and all forms appear in help and documentation. If multiple forms are given, the last value is used #548 - [bugfix] Progress bar now reaches 100% when processing variable framerate (VFR) videos, with both the OpenCV and PyAV backends #561
- [bugfix] Fix
AdaptiveDetector/detect-adaptiveemitting scenes shorter thanmin_scene_lenwhenwindow_widthis large, by applying the minimum-length check to the emitted (target) frame instead of the current frame #408
API Changes
- [api] Legacy
framerateargument aliases inFrameTimecode,open_video(), and the video backends now emit aDeprecationWarning; useframe_rateinstead. When both forms are provided,frame_ratetakes precedence #548 - [api]
write_scene_list()now also accepts a path (strorpathlib.Path) as the first argument in addition to an open file handle; paths are opened and closed automatically #523 - [api] Scene-list output functions for EDL, FCPXML, FCP7 XML, and OTIO now accept an open text file handle, a string path, or a
pathlib.Path; paths are opened and closed automatically #567 - [bugfix]
ThresholdDetector/detect-thresholdwith methodCEILINGnow classifies the first frame with theCEILINGrule instead of theFLOORrule, which anchored a leading fade one frame late and could emit a spurious cut at the first frame (thanks @MuhammadBilalKhan267) - [bugfix] Fix
min_scene_lengiven in frames dropping cuts that are exactlymin_scene_lenframes apart at NTSC framerates (e.g. 29.97 fps), by comparing frame counts instead of converting to seconds #577 - [bugfix] Fix
TypeErrorwhen opening videos with thepyavbackend on PyAV 19.0 or newer (PyAV 19 is now supported) - [bugfix] Fix
pyavbackend duration calculation fallback - [bugfix] Fix
pyavbackend not releasing the file handle it opened when the stream is garbage collected, which emitted aResourceWarningunderpython -X dev#568 - [bugfix] Work around an intermittent segfault on exit with the OpenCV backend on Windows when opening PNG image sequences with
opencv-python4.14 or 5.0 (upstream: opencv/opencv#30017) #575
Packaging
- [general] The Windows distribution now bundles PyAV 19 and FFmpeg 9.0
- [general] The
scenedetect-corepackage introduced in 0.7.1 has been discontinued, and its only release (0.7.1) yanked from PyPI. Existingscenedetect-coreinstalls keep working but will not receive updates. Install eitherscenedetectorscenedetect-headless. #558