scenedetect

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

https://github.com/breakthrough/pyscenedetect

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 37 committers (2.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary

Keywords

analysis image-processing opencv python python-opencv scene-detection scene-recognition video video-processing

Keywords from Contributors

closember manim animations network-simulation hacking static-code-analysis pep8 code-quality optim static-analysis
Last synced: 6 months ago · JSON representation ·

Repository

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

Basic Info
  • Host: GitHub
  • Owner: Breakthrough
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage: https://www.scenedetect.com/
  • Size: 170 MB
Statistics
  • Stars: 4,161
  • Watchers: 67
  • Forks: 456
  • Open Issues: 66
  • Releases: 36
Topics
analysis image-processing opencv python python-opencv scene-detection scene-recognition video video-processing
Created over 11 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

PySceneDetect

Video Cut Detection and Analysis Tool

Build Status PyPI Status PyPI Version PyPI License


Latest Release: v0.6.7 (August 24, 2025)

Website: scenedetect.com

Quickstart Example: scenedetect.com/cli/

Documentation: scenedetect.com/docs/

Discord: https://discord.gg/H83HbJngk7


Quick Install:

pip install scenedetect[opencv] --upgrade

Requires ffmpeg/mkvmerge for video splitting support. Windows builds (MSI installer/portable ZIP) can be found on the download page.


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 (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):

python 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:

python 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):

python 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:

```python from scenedetect import openvideo, SceneManager, splitvideoffmpeg from scenedetect.detectors import ContentDetector from scenedetect.videosplitter import splitvideoffmpeg

def splitvideointoscenes(videopath, threshold=27.0): # Open our video, create a scene manager, and add a detector. video = openvideo(videopath) scenemanager = SceneManager() scenemanager.adddetector( ContentDetector(threshold=threshold)) scenemanager.detectscenes(video, showprogress=True) scenelist = scenemanager.getscenelist() splitvideoffmpeg(videopath, scenelist, show_progress=True) ```

See the documentation for more examples.

Benchmark:

We evaluate the performance of different detectors in terms of accuracy and processing speed. See the benchmark report for details.

Reference

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-2024 Brandon Castellano. All rights reserved.

Owner

  • Name: Brandon Castellano
  • Login: Breakthrough
  • Kind: user
  • Location: Canada
  • Company: Google

Software engineer with experience in embedded development, computer vision and operating systems. Currently at Google, working on Fuchsia.

Citation (CITATION.cff)

cff-version: 1.2.0
title: PySceneDetect
message: www.scenedetect.com
type: software
authors:
  - given-names: Brandon
    family-names: Castellano
    affiliation: www.bcastell.com
repository-code: 'https://github.com/Breakthrough/PySceneDetect'
url: 'https://www.scenedetect.com'
abstract: Video Cut Detection and Analysis Tool
license: BSD-3-Clause

GitHub Events

Total
  • Create event: 37
  • Release event: 5
  • Issues event: 74
  • Watch event: 816
  • Delete event: 31
  • Member event: 1
  • Issue comment event: 134
  • Push event: 276
  • Pull request review comment event: 16
  • Pull request review event: 24
  • Pull request event: 44
  • Fork event: 61
Last Year
  • Create event: 37
  • Release event: 5
  • Issues event: 74
  • Watch event: 816
  • Delete event: 31
  • Member event: 1
  • Issue comment event: 134
  • Push event: 276
  • Pull request review comment event: 16
  • Pull request review event: 24
  • Pull request event: 44
  • Fork event: 61

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 1,372
  • Total Committers: 37
  • Avg Commits per committer: 37.081
  • Development Distribution Score (DDS): 0.1
Past Year
  • Commits: 195
  • Committers: 9
  • Avg Commits per committer: 21.667
  • Development Distribution Score (DDS): 0.092
Top Committers
Name Email Commits
Brandon Castellano b****8@g****m 1,235
wjs018 w****8@g****m 46
Joshua Coales j****a@c****k 26
Tony Cebzanov t****u@g****m 7
Brandon Castellano b****o@g****m 6
Daniel Morgan d****n@d****g 5
dependabot[bot] 4****] 5
welix t****y@g****m 5
Lyuboslav Petrov p****v@g****m 3
Jonas e****o@g****m 2
dadus33 l****s@g****m 2
Kian-Meng Ang k****g@g****m 2
João Faria 4****a 2
Jan Chang 5****e 2
Ivan Korostelev i****r@g****m 2
邢欣 x****n@b****m 1
tpltnt t****b@d****t 1
Marcellus Amadeus 7****s@g****m 1
lgtm-com[bot] 4****] 1
leingang m****g@g****m 1
e271828- e****- 1
deacon l****n@g****m 1
Tal Kain t****l@k****t 1
Soumitra Agarwal a****4@g****m 1
Sara Veldhoen V****n 1
Petr Pulc p****c@g****m 1
Oliver Broomhall o****l@g****m 1
Nathaniel Chin 2****m 1
Martin Tillmann m****n@g****m 1
Markus Bauer s****e@s****e 1
and 7 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 221
  • Total pull requests: 84
  • Average time to close issues: 6 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 130
  • Total pull request authors: 19
  • Average comments per issue: 2.98
  • Average comments per pull request: 1.5
  • Merged pull requests: 71
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 58
  • Pull requests: 57
  • Average time to close issues: 19 days
  • Average time to close pull requests: 9 days
  • Issue authors: 30
  • Pull request authors: 7
  • Average comments per issue: 1.21
  • Average comments per pull request: 0.74
  • Merged pull requests: 46
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
  • Breakthrough (58)
  • tormento (5)
  • babyta (5)
  • yumianhuli1 (4)
  • whatforiam (4)
  • AhmedEwis (3)
  • pengyouak (3)
  • raj6996 (3)
  • zaterio (2)
  • awkrail (2)
  • Mensen (2)
  • jeremymeyers (2)
  • ghost (2)
  • macguruza (2)
  • theojk1 (2)
Pull Request Authors
  • Breakthrough (32)
  • awkrail (12)
  • wjs018 (12)
  • dependabot[bot] (7)
  • Janscode (4)
  • ash2703 (2)
  • moritzbrantner (2)
  • oliviernguyenquoc (2)
  • lgtm-com[bot] (1)
  • chyang-nycu (1)
  • Veldhoen (1)
  • Mtillmann (1)
  • jeremymeyers (1)
  • kianmeng (1)
  • leingang (1)
Top Labels
Issue Labels
feature (38) improvement (36) bug (32) status: completed (26) technical item (11) help wanted (9) awaiting response (7) known issue (6) won't fix (4) discussion (4) good first issue (4) feedback required (4) status: awaiting response (3) duplicate (3) not reproducible (3) in progress (3) status: duplicate (2) status: won't fix (2) status: invalid (2) status: backlog (1) community feedback requested (1) status: in progress (1) status: accepted (1) obsolete (1) invalid (1)
Pull Request Labels
feature (10) dependencies (7) technical item (7) improvement (7) bug (6) status: completed (2) status: in progress (2) github_actions (2) python (1)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 1,005,341 last-month
  • Total docker downloads: 1,772
  • Total dependent packages: 13
    (may contain duplicates)
  • Total dependent repositories: 87
    (may contain duplicates)
  • Total versions: 76
  • Total maintainers: 1
pypi.org: scenedetect

Video scene cut/shot detection program and Python library.

  • Versions: 26
  • Dependent Packages: 13
  • Dependent Repositories: 87
  • Downloads: 1,005,341 Last month
  • Docker Downloads: 1,772
Rankings
Dependent packages count: 0.9%
Downloads: 1.4%
Stargazers count: 1.5%
Dependent repos count: 1.6%
Average: 1.8%
Docker downloads count: 2.4%
Forks count: 2.9%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/breakthrough/pyscenedetect
  • Versions: 25
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago
proxy.golang.org: github.com/Breakthrough/PySceneDetect
  • Versions: 25
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • jinja2 ==3.0.3
  • mkdocs ==1.2.3
manual/requirements.txt pypi
  • Sphinx ==4.4.0
  • av *
  • numpy *
  • opencv-python *
requirements.txt pypi
  • appdirs *
  • av <=8.0.3
  • av *
  • click *
  • numpy *
  • opencv-python ==4.5.1.48
  • pytest >=7.0
  • tqdm *
requirements_headless.txt pypi
  • appdirs *
  • av <=8.0.3
  • av *
  • click *
  • numpy *
  • opencv-python-headless *
  • pytest >=7.0
  • tqdm *
.github/workflows/check-code-format.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/codeql.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite