Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

PySceneDetect

> 开发工具
Open source

:movie_camera: Python and OpenCV-based scene cut/transition detection program & library.

5.1K stars0 likes0 views
WebsiteGitHub

About

:movie_camera: Python and OpenCV-based scene cut/transition detection program & library.

Video Cut Detection and Analysis Tool


Latest Release: v0.7.1 (July 21, 2026)

Website: scenedetect.com

Quickstart Example: scenedetect.com/cli/

Documentation: scenedetect.com/docs/

Discord: https://discord.gg/H83HbJngk7


Quick Install:

pip install scenedetect --upgrade

Requires ffmpeg/mkvmerge for video splitting support. Windows builds (MSI installer/portable ZIP) can be found on the download page. A Docker image with all dependencies included is available as ghcr.io/breakthrough/pyscenedetect.


Quick Start (Command Line):

Split input video on each fast cut using ffmpeg:

scenedetect -i video.mp4 split-video

Save some frames from each cut:

scenedetect -i video.mp4 save-images

Skip the first 10 seconds of the input video:

scenedetect -i video.mp4 time -s 10s

More examples can be found throughout the documentation.

Quick Start (Docker):

The same commands work without installing anything using the official Docker image, which includes all dependencies (ffmpeg/mkvmerge included). Mount the folder containing your videos and use it for input/output paths:

docker run --rm -v "$(pwd):/files" ghcr.io/breakthrough/pyscenedetect -i /files/video.mp4 split-video -o /files

Quick Start (Python API):

To get started, there is a high level function in the library that performs content-aware scene detection on a video (try it from a Python prompt):

from scenedetect import detect, ContentDetector

scene_list = detect("my_video.mp4", ContentDetector())

scene_list will now be a list containing the start/end times of all scenes found in the video. There also exists a two-pass version AdaptiveDetector which handles fast camera movement better, and ThresholdDetector for handling fade out/fade in events.

Try calling print(scene_list), or iterating over each scene:

from scenedetect import detect, ContentDetector

scene_list = detect("my_video.mp4", ContentDetector())
for i, scene in enumerate(scene_list):
    print(
        "    Scene %2d: Start %s / Frame %d, End %s / Frame %d"
        % (
            i + 1,
            scene[0].get_timecode(),
            scene[0].frame_num,
            scene[1].get_timecode(),
            scene[1].frame_num,
        )
    )

We can also split the video into each scene if ffmpeg is installed (mkvmerge is also supported):

from scenedetect import detect, ContentDetector, split_video_ffmpeg

scene_list = detect("my_video.mp4", ContentDetector())
split_video_ffmpeg("my_video.mp4", scene_list)

For more advanced usage, the API is highly configurable, and can easily integrate with any pipeline. This includes using different detection algorithms, splitting the input video, and much more. The following example shows how to implement a function similar to the above, but using the scenedetect API:

…

See the documentation for more examples.

Benchmark:

We evaluate the performance of different detectors in terms of accuracy and processing speed. See www.scenedetect.com/benchmarks for results, or the benchmark report for details on the datasets and methodology.

Reference

  • Documentation (covers application and Python API)
  • CLI Example
  • Config File

Help & Contributing

Please submit any bugs/issues or feature requests to the Issue Tracker. Before submission, ensure you search through existing issues (both open and closed) to avoid creating duplicate entries. Pull requests are welcome and encouraged. PySceneDetect is released under the BSD 3-Clause license, and submitted code should be compliant.

For help or other issues, you can join the official PySceneDetect Discord Server, submit an issue/bug report here on Github, or contact me via my website.

Code Signing

This program uses free code signing provided by SignPath.io, and a free code signing certificate by the SignPath Foundation

License

BSD-3-Clause; see LICENSE and THIRD-PARTY.md for details.


Copyright (C) 2014 Brandon Castellano. All rights reserved.

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •Documentation (covers application and Python API)
  • •CLI Example
  • •Config File

> Tags

Pythonanalysisimage-processingopencvpython

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具