From video-editing
Remove unwanted tracks (audio, subtitle, video) from a Matroska container and save a new, smaller file. Use mkvmerge syntax (-a, -s, -d to keep tracks; -A, -S, -D to drop all of a type). Use when the user says "remove this audio track", "drop all subtitles except English", "keep only this video and audio", "make this file smaller". No re-encode.
npx claudepluginhub danielrosehill/claude-code-plugins --plugin video-editingThis skill is limited to using the following tools:
Selectively keep or discard audio, subtitle, and video tracks in a Matroska container using mkvmerge. Produces a new MKV with only the requested tracks; original is preserved. No re-encoding.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Selectively keep or discard audio, subtitle, and video tracks in a Matroska container using mkvmerge. Produces a new MKV with only the requested tracks; original is preserved. No re-encoding.
1,2) or language codes; OR -A to drop all audio (optional)3,4) or -S to drop all subs (optional)0) or -D to drop all video (rare) (optional, default: keep track 0)<original-name>.stripped.mkv in same dir)if ! command -v mkvmerge >/dev/null; then
echo "mkvtoolnix not installed. Install: apt install mkvtoolnix"
exit 1
fi
mkvmerge uses track-selection flags:
| Flag | Effect |
|---|---|
-d 0 | keep video track 0 |
-a 1,2 | keep audio tracks 1 and 2 |
-s 3 | keep subtitle track 3 |
-A | drop all audio |
-S | drop all subtitles |
-D | drop all video |
Example: keep video 0, audio 1, subs 3–4:
mkvmerge \
-d 0 -a 1 -s 3,4 \
-o "$OUTPUT" "$FILE"
Before running mkvmerge, query the source with mkvmerge -i "$FILE" to verify all requested track indices exist. Warn if a track is missing.
Print the full mkvmerge invocation and ask for confirmation (especially if many tracks will be dropped).
mkvmerge -d 0 -a "$AUDIO_TRACKS" -s "$SUB_TRACKS" -o "$OUTPUT" "$FILE"
After completion, show:
Source : path/to/in.mkv (12.5 MB)
Output : path/to/in.stripped.mkv (3.2 MB)
Removed : audio track 2, all other subtitles
Reduction : 74%
mkv-track-list. Not all indices are sequential (e.g., if you dropped a track earlier, indices don't shift).-a eng) is more portable than track indices if the MKV has proper language tags. mkvmerge supports ISO 639-2 codes.mkv-track-list first.--no-chapters).