From dad95f07289784ab87e62ced0f956a53ce9cdde3 Mon Sep 17 00:00:00 2001 From: Claude Toupin Date: Wed, 11 Nov 2026 05:01:43 -0500 Subject: [PATCH] Document Get-VideoSubtitles.ps1 in README.md, index.md and SKILL.md, describing subtitle extraction and -List behavior, supported text and Blu-ray PGS formats, unsupported DVD and DVB bitmap tracks, and replacement of same-named output files in the current directory --- Get-VideoSubtitles.cmd | 2 + Get-VideoSubtitles.ps1 | 104 ++++++++++++++++++ README.md | 1 + .../Get-VideoSubtitles.md | 97 ++++++++++++++++ video-processing-scripts/SKILL.md | 4 +- video-processing-scripts/index.md | 1 + 6 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 Get-VideoSubtitles.cmd create mode 100644 Get-VideoSubtitles.ps1 create mode 100644 video-processing-scripts/Get-VideoSubtitles.md diff --git a/Get-VideoSubtitles.cmd b/Get-VideoSubtitles.cmd new file mode 100644 index 0000000..cd1d368 --- /dev/null +++ b/Get-VideoSubtitles.cmd @@ -0,0 +1,2 @@ +@echo off +pwsh.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Get-VideoSubtitles.ps1" %* diff --git a/Get-VideoSubtitles.ps1 b/Get-VideoSubtitles.ps1 new file mode 100644 index 0000000..d20de2d --- /dev/null +++ b/Get-VideoSubtitles.ps1 @@ -0,0 +1,104 @@ +<# +.SYNOPSIS + Extracts the embedded subtitle tracks of a video file into the current directory. +.PARAMETER Video + Path to the input video file. Can be absolute or relative to current directory. +.PARAMETER List + When present, lists the subtitle tracks instead of extracting them. Creates no files. +.DESCRIPTION + This script uses ffprobe to list the subtitle streams of a video file and ffmpeg to copy each one out: + - Text subtitles (SubRip, WebVTT and mov_text, found in MKV, WebM, MP4, MOV and M4V) are written as .srt. + - ASS/SSA subtitles (MKV) are written as .ass, keeping their styling. + - Blu-ray PGS subtitles (hdmv_pgs_subtitle, found in MKV, M2TS and TS) are copied unchanged to .sup. + - Bitmap DVD subtitles (dvd_subtitle, found in MKV and VOB) and DVB subtitles (dvb_subtitle, found in TS) are listed but not extracted, because ffmpeg cannot write them as text or as a standalone file. + - AVI files have no standard subtitle track, so nothing is extracted from them. + Bitmap subtitles can only be turned into text with OCR, which this script does not do. + Each file is named "