/major-ai-skills:losslesscutfrom major-ai-skills
Trims and joins media using LosslessCut with keyframe-aligned stream copy, Smart Cut, and .llc v2 segment projects backed by FFmpeg.
Ships in major-ai-skills. 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.
LosslessCut (mifi/lossless-cut) is an Electron UI over FFmpeg stream copy (-c copy). Lossless cuts must start on decoder keyframes (IDR/I). Keyframe cut snaps start to a nearby keyframe (often earlier). Experimental Smart Cut re-encodes only from the desired start to the next keyframe, then copies the rest — unsupported for many files/codecs/multi-video-track cases.
Projects use .llc JSON5, schema version 2: mediaFileName, cutSegments[{ start, end?, name, tags?, selected? }].
┌─────────────────────────────────────────────────────────────┐
│ LosslessCut cut → export │
│ │
│ Analysis │
│ ├── ffprobe packets/flags → keyframes ('K') │
│ └── GOP spacing drives how “early” cuts start │
│ │
│ Cut modes │
│ ├── Keyframe cut (default, -ss before -i style) │
│ ├── Exact/frame modes with caveats │
│ └── Smart Cut (experimental hybrid re-encode bridge) │
│ │
│ Interchange │
│ ├── .llc v2 segments / CSV / YouTube chapters │
│ └── ffmpeg concat demuxer for merge │
└─────────────────────────────────────────────────────────────┘
Use when
.llc manifests or keyframe-aligned FFmpeg -c copy slices.Do not use when
@adobe-premiere-pro, @final-cut-pro, …).@ffmpeg (or Smart Cut only if it works for that file).-c copy, snap starts to keyframes; explain that exports may begin early when GOPs are long..llc v2: start required (seconds); end optional (EOF); include version: 2.-avoid_negative_ts make_zero; try MKV if MP4 PTS issues appear.-map 0 pattern in CLI equivalents).ffmpeg -c copy -movflags +faststart)..llc writer"""Keyframe-aligned lossless slice + LosslessCut .llc v2 companion."""
from __future__ import annotations
import json
import subprocess
import sys
from pathlib import Path
def nearest_keyframe(path: str, target: float, window: float = 8.0) -> float:
start = max(0.0, target - window)
cmd = [
"ffprobe", "-v", "quiet", "-select_streams", "v:0",
"-show_packets", "-show_entries", "packet=pts_time,flags",
"-read_intervals", f"{start}%+{window * 2}",
"-print_format", "json", path,
]
proc = subprocess.run(cmd, capture_output=True, text=True)
if proc.returncode != 0:
return target
best, best_diff = target, float("inf")
for pkt in json.loads(proc.stdout or "{}").get("packets", []):
if not str(pkt.get("flags", "")).startswith("K"):
continue
pts = float(pkt.get("pts_time", 0.0))
# Prefer keyframe at or before target (LosslessCut-style early snap)
if pts > target:
continue
diff = target - pts
if diff < best_diff:
best, best_diff = pts, diff
return best
def write_llc(media_name: str, segments: list[dict], out: Path) -> None:
doc = {"version": 2, "mediaFileName": media_name, "cutSegments": segments}
out.write_text(json.dumps(doc, indent=2), encoding="utf-8")
def lossless_slice(src: str, start: float, end: float, dst: str) -> None:
safe = nearest_keyframe(src, start)
cmd = [
"ffmpeg", "-y",
"-ss", str(safe), "-i", src,
"-to", str(end - safe),
"-c", "copy", "-avoid_negative_ts", "make_zero",
"-movflags", "+faststart", dst,
]
subprocess.run(cmd, check=True)
write_llc(
Path(src).name,
[{"start": safe, "end": end, "name": "auto-slice"}],
Path(dst).with_suffix(".llc"),
)
if __name__ == "__main__":
if len(sys.argv) < 5:
print("Usage: keyframe_slicer.py in.mp4 start end out.mp4")
sys.exit(1)
lossless_slice(sys.argv[1], float(sys.argv[2]), float(sys.argv[3]), sys.argv[4])
UI checklist:
1. Toggle Keyframe cut; jump ALT+←/→ between keyframes; set In on/after keyframe
2. Enable needed Tracks (audio/subs)
3. Export: avoid_negative_ts = make_zero; try MKV if MP4 freezes
4. Only then try Smart Cut if frame-exact start is mandatory
| Signature | Likely cause | Fix path |
|---|---|---|
| Black/freeze first seconds | Cut on non-keyframe | Keyframe cut; snap to prior IDR; or Smart Cut |
| Export starts seconds early | Long GOP | Expected in keyframe mode; denser keyframes or Smart Cut/re-encode |
| Audio OK, video frozen | Negative/bad PTS | avoid_negative_ts make_zero; try MKV |
| Missing commentary/subs | Tracks unchecked | Enable tracks; CLI -map 0 |
Invalid NAL unit size | Corrupt MP4 | Remux heal then cut |
| Smart Cut fails/artifacts | Unsupported codec/layout | Disable Smart Cut; full re-encode segment |
| Audio-only cut wrong | Sync sample table | Disable Keyframe cut or remux whole file first |
.llc beside media for resume/review.@ffmpeg silencedetect for podcast dead-air → .llc generation..llc + FFmpeg.@ffmpeg — probes, re-encodes, concat, filters@adobe-premiere-pro / @final-cut-pro — editorial after selects@davinci-resolve — finish grade on selectsMANDATORY: For stream-copy cuts, align starts to keyframes and use
-avoid_negative_ts make_zero. Treat Smart Cut as experimental and verify outputs. Emit.llcv2 with numericstart. Never assist with DRM circumvention.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills2 plugins in one repository ship this exact skill · first indexed Oct 25, 2026
412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization.Other plugins' skills for the same job
/act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.