/media-os:media-scenedetect [input]from media-os
Reliable scene-change detection using PySceneDetect CLI. Detects shot boundaries via content-aware, adaptive, or threshold methods. Splits video, generates thumbnails, and exports scene lists.
Ships in media-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
PySceneDetect is the go-to tool for reliable scene-change detection. It is superior to ffmpeg's built-in scdet filter, especially on anime, stylized, and low-contrast content. The scenedetect CLI chains a detector (detect-content, detect-adaptive, detect-threshold) with one or more commands (list-scenes, save-images, split-video, export-html) in a single invocation.
scenedetect -i in.mp4 detect-content list-scenes)split-video -m for stream-copy via mkvmerge)save-images -n 3 -o thumbs)chapters subcommand)scdet is returning noisy / missed cuts on stylized, anime, or dark content.pip install scenedetect[opencv] # recommended (bundled OpenCV wheel)
pip install scenedetect[opencv-headless] # headless servers, no GUI deps
pip install scenedetect # core only — OpenCV already present
Verify: scenedetect version. Splitting requires ffmpeg (default) or mkvmerge on PATH.
Detectors are mutually exclusive positional commands:
| Detector | When | Typical threshold |
|---|---|---|
detect-content | Default. Content-aware via HSV deltas. Best general choice. | -t 27 (default). Range 15–40. |
detect-adaptive | Mixed pacing, slow fades, camera motion. Rolling average of content metric. | -t 3.0 (default adaptive ratio). |
detect-threshold | Fade-to-black detection or hard-cut-only content. | -t 12 (default, 0–255 luma). |
detect-hash | Perceptual hash; good for detecting duplicate/near-duplicate frames. | -t 0.395. |
Threshold intuition: higher threshold ⇒ fewer scenes (more tolerant of change). Lower for dark or low-contrast content; raise for noisy / shaky handheld.
Minimum scene length: pass -m 2.0 (seconds) to the detector to drop micro-cuts under 2s.
Luma-only fast mode: detect-content -l skips HSV, uses only luma — cheap on CPU.
Single-detector + list:
scenedetect -i in.mp4 detect-content list-scenes -o scenes.csv
Chain multiple outputs in one pass (detector runs once):
scenedetect -i in.mp4 \
detect-content -t 27 -m 2.0 \
list-scenes -o scenes.csv \
save-images -n 3 -o thumbs \
split-video -o parts -m
Global options worth knowing:
-o DIR — global output directory (applies to all commands unless overridden).-s STATS.csv — write per-frame metric CSV (very useful for threshold tuning).--downscale N — process every Nth pixel (N=4 for 4K); massive speed-up.--start T, --end T, --duration T — limit analysis range (skip intros).-v quiet|error|warning|info|debug — verbosity.# Re-encode via ffmpeg — exact cuts, slow
scenedetect -i in.mp4 detect-content split-video -o parts
# Stream-copy via mkvmerge — fast, cuts only at keyframes (not frame-exact)
scenedetect -i in.mp4 detect-content split-video -m -o parts
split-video requires ffmpeg unless -m is passed (then needs mkvmerge). Output filenames default to $VIDEO_NAME-Scene-001.mp4 etc.
scenedetect -i in.mp4 detect-content save-images -n 3 -o thumbs
-n N = images per scene (default 3: first / middle / last). JPG by default; add --jpeg-quality 95 or switch with --png. Useful for chapter art or contact sheet.
No first-class chapter exporter — convert list-scenes CSV to ffmetadata format (the helper script's chapters subcommand does this). Then:
ffmpeg -i in.mp4 -i chapters.txt -map_metadata 1 -codec copy out.mp4
scenedetect -i in.mp4 detect-content list-scenes save-images export-html -o report.html
Self-contained HTML with thumbnails + timecodes. Great for editorial review.
scripts/scenedetect.py — stdlib wrapper with check, detect, split, thumbnails, html-report, chapters subcommands. All support --dry-run and --verbose.# Verify install
uv run ${CLAUDE_SKILL_DIR}/scripts/scenedetect.py check
# Detect, get scene list as JSON
uv run ${CLAUDE_SKILL_DIR}/scripts/scenedetect.py detect \
--input in.mp4 --method content --threshold 27 --min-duration 2.0
# Split with stream-copy
uv run ${CLAUDE_SKILL_DIR}/scripts/scenedetect.py split \
--input in.mp4 --outdir parts --stream-copy
# Per-scene thumbnails
uv run ${CLAUDE_SKILL_DIR}/scripts/scenedetect.py thumbnails \
--input in.mp4 --outdir thumbs --per-scene 3
# HTML report
uv run ${CLAUDE_SKILL_DIR}/scripts/scenedetect.py html-report \
--input in.mp4 --output report.html
# Build ffmetadata chapter file
uv run ${CLAUDE_SKILL_DIR}/scripts/scenedetect.py chapters \
--input in.mp4 --output chapters.txt
references/scenedetect.md for detector comparison, threshold tuning per content type, CSV/JSON/HTML formats, scdet vs PySceneDetect, and recipe book (auto-chapter DVD, commercial detection, video summaries).scenedetect -i FILE <detect-X> <cmd1> <cmd2> ... — detect-X runs first; every command after re-uses its output. ALL can run in one invocation.detect-content; default 27. Higher = fewer scenes. Lower for dark / low-contrast; raise for noisy / shaky.split-video defaults to re-encoding via ffmpeg — slow. Pass -m to stream-copy with mkvmerge — fast, but cuts fall on keyframes only (not frame-exact).save-images default is 3 per scene (first / middle / last). -n N overrides.-m on the detector sets minimum scene duration (seconds). -m on split-video means "use mkvmerge". Same flag letter, different meaning per command.detect-content; on grayscale content use -l (luma-only) for speed.detect-adaptive.--downscale 4 (process every 4th pixel). Cuts runtime massively with negligible accuracy loss.--start 60 --duration 120) — threshold varies per content type.scdet on anime / stylized / low-contrast content. Use scdet only when you already have ffmpeg in the pipeline and content is live-action.Scene Number, Start Frame, Start Time (seconds), Start Timecode, End Frame, End Time (seconds), End Timecode, Length (frames), Length (seconds), Length (timecode).-c copy — but accept that cuts align to the nearest keyframe anyway.ffmpeg required unless splitting. Analysis itself only needs OpenCV / PySceneDetect.--start + --duration skip intros / limit range; applies globally.scenedetect -i movie.mkv \
detect-adaptive -m 5.0 \
list-scenes -o scenes.csv save-images -n 1 -o chapter_art
# then convert scenes.csv → chapters.txt via helper script
uv run scripts/scenedetect.py chapters --input movie.mkv --output chapters.txt
ffmpeg -i movie.mkv -i chapters.txt -map_metadata 1 -c copy movie_chap.mkv
# Fades to black are the commercial breaks — use threshold detector
scenedetect -i recording.ts detect-threshold -t 8 list-scenes -o breaks.csv
scenedetect -i vlog.mp4 detect-content -t 30 -m 3.0 save-images -n 1 -o frames
# then montage via ImageMagick
magick montage frames/*.jpg -tile 6x -geometry 320x180+4+4 summary.jpg
scenedetect --downscale 4 -i 4k.mp4 detect-content -l -m 2.0 list-scenes -o scenes.csv
scenedetect: command not foundCause: not installed or not on PATH.
Solution: pip install scenedetect[opencv]. If installed in a venv, activate it or use python -m scenedetect ....
Failed to open video: <file> / cv2.errorCause: OpenCV can't decode the container (some MKVs with odd codecs).
Solution: re-mux to mp4 first (ffmpeg -i in.mkv -c copy in.mp4) or install full scenedetect[opencv] wheel.
Cause: threshold off for your content.
Solution: generate a stats file (-s stats.csv) to see per-frame metric, then pick threshold above typical baseline but below scene-cut spikes.
split-video produced weird-length segmentsCause: -m (mkvmerge) only cuts on keyframes — GOP-aligned, not frame-exact.
Solution: drop -m to re-encode (frame-exact) or raise GOP density at encode time.
Cause: rolling window smoothing threshold too high for slow-paced content.
Solution: lower -t (e.g. -t 2.0), or fall back to detect-content with a high min-duration.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub damionrashford/media-os --plugin media-os110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
Other plugins' skills for the same job