Release Notes
PySceneDetect v0.6 is a major breaking change including better performance, configuration file support, and a more ergonomic API. The new minimum Python version is now 3.6. See the Migration Guide for information on how to port existing applications to the new API. Most users will see performance improvements after updating, and changes to the command-line are not expected to break most workflows.
The main goals of v0.6 are reliability and performance. To achieve this required several breaking changes. The video input API was refactored, and many technical debt items were addressed. This should help the eventual transition to the first planned stable release (v1.0) where the goal is an improved scene detection API.
Both the Windows installer and portable distributions now include signed executables. Many thanks to SignPath, AppVeyor, and AdvancedInstaller for their support.
Changelog
Overview:
- Major performance improvements on multicore systems
- Configuration file support via command line option or user settings folder
- Support for multiple video backends, PyAV is now supported in addition to OpenCV
- Breaking API changes to
VideoManager
(replaced withVideoStream
),StatsManager
, andsave_images()
- See the Migration Guide for details on how to update from v0.5.x
- A backwards compatibility layer has been added to prevent most applications from breaking, will be removed in a future release
- Support for Python 2.7 has been dropped, minimum supported Python version is 3.6
- Support for OpenCV 2.x has been dropped, minimum OpenCV version is 3.x
- Windows binaries are now signed, thanks SignPath.io (certificate by SignPath Foundation)
Command-Line Changes:
- Configuration files are now supported, see documentation for details
- Can specify config file path with
-c
/--config
, or create ascenedetect.cfg
file in your user config folder
- Can specify config file path with
- Frame numbers are now 1-based, aligning with most other tools (e.g.
ffmpeg
) and video editors (#265) - Start/end frame numbers of adjacent scenes no longer overlap (#264)
- End/duration timecodes still include the frame's presentation time
- Add
--merge-last-scene
option to merge last scene if shorter than--min-scene-len
- Add
-b
/--backend
option to use a specific video decoding backend- Supported backends are
opencv
andpyav
- Run
scenedetect help
to see a list of backends available on the current system - Both backends are included with Windows builds
- Supported backends are
split-video
command:detect-adaptive
command:--drop-short-scenes
now works properly withdetect-adaptive
detect-content
command:- Default threshold
-t
/--threshold
lowered to 27 to be more sensitive to shot changes (#246) - Add override for global
-m
/--min-scene-len
option
- Default threshold
detect-threshold
command:- Remove
-p
/--min-percent
and-b
/--block-size
options - Add override for global
-m
/--min-scene-len
option
- Remove
save-images
command now works when-i
/--input
is an image sequences- Default backend (OpenCV) is more robust to video decoder failures
-i
/--input
may no longer be specified multiple times, if required use an external tool (e.g.ffmpeg
,mkvmerge
) to perform concatenation before processing-s
/--stats
no longer loads existing statistics and will overwrite any existing files-l
/--logfile
now respects-o
/--output
-v
/--verbosity
now takes precedence over-q
/--quiet
API Changes:
- New
detect()
function performs scene detection on a video path, see example here - New
open_video()
function to handle video input, see example here split_video_ffmpeg()
andsplit_video_mkvmerge()
now take a single path as inputsave_images()
no longer acceptsdownscale_factor
- Use
scale
orheight
/width
arguments to resize images
- Use
- New
VideoStream
replacesVideoManager
(#213)- Supports both OpenCV (
VideoStreamCv2
) and PyAV (VideoStreamAv
) - Improves video seeking invariants, especially around defining what frames 0 and 1 mean for different time properties (
frame_number
is 1-based whereasposition
is 0-based to align with PTS) - See
test_time_invariants
intests/test_video_stream.py
as a reference of specific behaviours
- Supports both OpenCV (
- Changes to
SceneManager
:detect_scenes()
now performs video decoding in a background thread, improving performance on most systemsSceneManager
is now responsible for frame downscaling via thedownscale
/auto_downscale
propertiesdetect_scenes()
no longer shows a progress bar by default, setshow_progress=True
to restore the previous behaviourclear()
now clears detectors, as they may be statefulget_scene_list()
now returns an empty list if there are no detected cuts, specifystart_in_scene=True
for previous behavior (one scene spanning the entire input)
- Changes to
StatsManager
:save_to_csv()
now accepts a path or an open file handlebase_timecode
argument has been removed fromsave_to_csv()
load_from_csv()
is now deprecated and will be removed in v1.0
- Changes to
FrameTimecode
:- Use rounding instead of truncation when calculating frame numbers to fix incorrect round-trip conversions and improve accuracy (#268)
- Fix
previous_frame()
generating negative frame numbers in some cases FrameTimecode
objects can now perform arithmetic with formatted strings, e.g.'HH:MM:SS.nnn'
- Merged constants
MAX_FPS_DELTA
andMINIMUM_FRAMES_PER_SECOND_DELTA_FLOAT
inscenedetect.frame_timecode
into newMAX_FPS_DELTA
constant video_manager
parameter has been removed from theAdaptiveDetector
constructorsplit_video_ffmpeg
andsplit_video_mkvmerge
function arguments have been renamed and defaults updated:suppress_output
is nowshow_output
, default isFalse
hide_progress
is nowshow_progress
, default isFalse
block_size
argument has been removed from theThresholdDetector
constructorcalculate_frame_score
method ofContentDetector
has been renamed to_calculate_frame_score
, use new module-level function of the same name insteadget_aspect_ratio
has been removed fromscenedetect.platform
(use theaspect_ratio
property of aVideoStream
instead)- Backwards compatibility with v0.5 to avoid breaking most applications on release while still allowing performance improvements
Python Distribution Changes
- v0.6.0.3 - Fix missing package description
- v0.6.0.2 - Improve error messaging when OpenCV is not installed
- v0.6.0.1 - Fix original v0.6 release requiring
av
to run thescenedetect
command
Known Issues
- URL inputs are not supported by the
save-images
orsplit-video
commands - Variable framerate videos (VFR) are not fully supported, and will yield incorrect timestamps (#168)
- The
detect-threshold
option-l
/--add-last-scene
cannot be disabled - Due to a switch from EXE to MSI for the Windows installer, you may have to uninstall older versions first before installing v0.6