Skip to main content

shotsplit

Shot segment range extraction for video files.

The PyPI distribution name and Python import package are both shotsplit. shotsplit currently uses AutoShot as its default shot-boundary detection model.

Install

python -m pip install shotsplit

Or with uv:

uv pip install shotsplit

This installs the package and its runtime dependencies, including PyTorch. ShotSplitter() runs on CPU by default.

Install With A Specific PyTorch Build

PyPI package metadata cannot encode alternate PyTorch wheel indexes for CPU and CUDA builds. To force a specific PyTorch build, install PyTorch first, then install shotsplit.

CPU-only PyTorch:

uv pip install torch --index-url https://download.pytorch.org/whl/cpu
uv pip install shotsplit

CUDA 12.8 PyTorch:

uv pip install torch --index-url https://download.pytorch.org/whl/cu128
uv pip install shotsplit

The same sequence works with python -m pip install ... if you do not use uv.

Usage

from shotsplit import ShotSplitter, __version__

print(__version__)

with ShotSplitter() as splitter:
    clips = splitter.split("example.mp4", threshold=0.2)

print(clips)

ShotSplitter() uses CPU by default. To use CUDA, install a CUDA-enabled PyTorch build and pass device="cuda" explicitly:

with ShotSplitter(device="cuda") as splitter:
    clips = splitter.split("example.mp4", threshold=0.2)

The result is a list of half-open frame ranges:

[{"start_frame": 0, "end_frame": 100}, {"start_frame": 100, "end_frame": 150}]

start_frame and end_frame are frame indexes. end_frame is exclusive. By default, transition frames are included in the adjacent segments so the returned segments cover every decoded frame.

To exclude transition frames from the returned segments, pass include_transition_frames=False:

with ShotSplitter() as splitter:
    clips = splitter.split(
        "example.mp4",
        threshold=0.2,
        include_transition_frames=False,
    )

For boundary metadata and optional per-frame scores, use analyze():

with ShotSplitter() as splitter:
    result = splitter.analyze(
        "example.mp4",
        threshold=0.2,
        include_transition_frames=False,
        include_scores=True,
    )

print(result["segments"])
print(result["boundaries"])

boundaries contains thresholded AutoShot score runs:

[
    {
        "split_frame": 100,
        "run_start_frame": 98,
        "run_end_frame": 102,
        "peak_frame": 101,
        "peak_score": 0.91,
    }
]

run_start_frame and run_end_frame are inclusive. When include_transition_frames=False, these transition run frames are omitted from segments. If include_scores=True, frame_scores contains one score per decoded frame.

The default AutoShot weights are included in the package. To use a different checkpoint, pass weights_path.

Metadata

Release files for shotsplit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shotsplit 0.1.0
File Size Uploaded
shotsplit-0.1.0.tar.gz 53.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for shotsplit 0.1.0
File Interpreter ABI Platform
shotsplit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 106.2 MB

Release files / shotsplit-0.1.0.tar.gz

Download URL shotsplit-0.1.0.tar.gz
Size 53.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c35babce82dd0e3f760ddd17fccff954347e1c42391a62f45bc9e9078ab4f777
BLAKE2b-256 checksum
How to use checksums
d0ff6c84a751f4f7ff4c853e1aad594da60f99da92baa435c0a205c926f4e704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release files / shotsplit-0.1.0-py3-none-any.whl

Download URL shotsplit-0.1.0-py3-none-any.whl
Size 53.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b8e7b7eb817425b15df866efd8d6adf3bce0717fd7a78e7ed4948036ec11c484
BLAKE2b-256 checksum
How to use checksums
a87530685c32878eed72586fe0c1cae3cf1ef3a41026dfc566d7b73e3741f3e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page