diff --git a/skill/Clone-Video.md b/skill/Clone-Video.md index 2b8ce7a..b896e43 100644 --- a/skill/Clone-Video.md +++ b/skill/Clone-Video.md @@ -43,8 +43,8 @@ The output container is chosen from the `-Target` extension (`.mp4`, `.webm`, or - **`-StartFrame`** (optional): 0-based frame index to start cloning from (default: 0). Mutually exclusive with `-Frames`. - **`-EndFrame`** (optional): 0-based frame index to end cloning at, use -1 for end (default: -1). Mutually exclusive with `-Frames`. - **`-Frames`** (optional): 0-based frame range to clone. Mutually exclusive with `-StartFrame`, `-EndFrame`, and `-Sequence`. Supported formats: - - `start-end`: Clone frames from `start` to `end` (e.g., `"100-500"`) - - `positive_number`: Clone frames from 0 to that number (e.g., `"50"`) + - `start-end`: Clone frames from `start` to `end` (e.g., `"100-500"`). Both ends must lie inside the video, and `start` must not be greater than `end`. Otherwise the script stops with exit code `1`. + - `positive_number`: Clone frames from 0 to that number (e.g., `"50"`). A single number past the last frame is clamped to the last frame (`"150"` on a 100-frame video gives frames 0 to 99). - `-N`: Clone the last N frames (e.g., `"-10"` clones frames 90 to 99 of a 100-frame video; `"-1"` clones the last frame only) - `%`: The last frame index. Alone (`"%"`) it selects only the last frame. In a range (e.g., `"10-%"`) it is the end of the range - `-%` is not supported and is rejected with exit code `1` diff --git a/skill/Create-Clip.md b/skill/Create-Clip.md index ad0662b..cda3350 100644 --- a/skill/Create-Clip.md +++ b/skill/Create-Clip.md @@ -8,8 +8,8 @@ Sources carrying a `.skip` marker keep that marker last: `P01.skip.mp4` becomes - **`-Video`** (required): Path to the input video file. Can be absolute or relative to current directory. Accepted containers: `.mp4`, `.webm`, `.mkv`. If the path has no extension the script tries `.mp4`, `.webm`, then `.mkv` in turn and uses the first match to determine the target filename extension. - **`-Frames`** (required): 0-based frame range to clip. Supported formats: - - `start-end`: Clip frames from `start` to `end` (e.g., `"100-200"`) - - `positive_number`: Clip frames from 0 to that number (e.g., `"50"`) + - `start-end`: Clip frames from `start` to `end` (e.g., `"100-200"`). Both ends must lie inside the video, and `start` must not be greater than `end`. Otherwise the script stops with exit code `1`. + - `positive_number`: Clip frames from 0 to that number (e.g., `"50"`). A single number past the last frame is clamped to the last frame (`"150"` on a 100-frame video gives frames 0 to 99). - `-N`: Clip the last N frames (e.g., `"-10"` clips frames 90 to 99 of a 100-frame video; `"-1"` clips the last frame only) - `%`: The last frame index. Alone (`"%"`) it selects only the last frame. In a range (e.g., `"10-%"`) it is the end of the range - `-%` is not supported and is rejected with exit code `1` diff --git a/skill/Get-FramesRange.md b/skill/Get-FramesRange.md index d660dc5..5227480 100644 --- a/skill/Get-FramesRange.md +++ b/skill/Get-FramesRange.md @@ -10,8 +10,8 @@ Extracts a specific range of frames from a video file to PNG images. ## Frame Range Formats -- **`start-end`**: Extract frames from start to end index (e.g., `100-200`) -- **`positive_number`**: Extract frames from 0 to that number (e.g., `50` extracts frames 0-50) +- **`start-end`**: Extract frames from start to end index (e.g., `100-200`). Both ends must lie inside the video, and `start` must not be greater than `end`. Otherwise the script stops with exit code `1`. +- **`positive_number`**: Extract frames from 0 to that number (e.g., `50` extracts frames 0-50). A single number past the last frame is clamped to the last frame (`150` on a 100-frame video gives frames 0 to 99). - **`-negative_number`**: Extract the last N frames (e.g., `-10` extracts frames 90 to 99 of a 100-frame video; `-1` extracts the last frame only) - **`%`**: The last frame index. Alone (`%`) it extracts only the last frame. In a range it is the end of the range: - `%` - Extract only the last frame diff --git a/skill/SKILL.md b/skill/SKILL.md index 0f313e3..71f0495 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -17,6 +17,23 @@ The per-script pages sit in the same folder as this file. Load a page only when - **Optional tools**, needed only by specific scripts: - **rife-ncnn-vulkan** on `PATH`, with `RIFE_HOME` set. Required by [Stitch-InBetween.ps1](Stitch-InBetween.md). See the [RIFE installation guide](RIFE.md). - **upscayl-bin** on `PATH`, with `UPSCAYL_HOME` set. Required by [Clone-Image.ps1](Clone-Image.md) when `-Upscale` is used. See the [Upscalers installation guide](Upscalers.md). +- **Tested with** ffmpeg n8.0.1-40 (GPL build, Windows 11). Do not claim that other versions work. + +### Encoders and filters required + +These encoders are used by the scripts. Check the ones a task needs before running it; see [Check the Environment](#check-the-environment). + +| Encoder or filter | Used by | Needed for | +| --- | --- | --- | +| `libx264` | [Clone-Video.ps1](Clone-Video.md), [Compare-Videos.ps1](Compare-Videos.md), [Create-PillarBox.ps1](Create-PillarBox.md), [Create-ShortClip.ps1](Create-ShortClip.md), [Crop-Clips.ps1](Crop-Clips.md) | H.264 video in MP4 and MKV output | +| `libx265` | [Create-ShortClip.ps1](Create-ShortClip.md) | Output of HEVC (H.265) sources | +| `libvpx-vp9` | [Clone-Video.ps1](Clone-Video.md) | Video in WebM output | +| `libopus` | [Clone-Video.ps1](Clone-Video.md) | Audio in WebM output | +| `libmp3lame` | [Get-VideoAudio.ps1](Get-VideoAudio.md) | MP3 extraction (`-MP3`) | +| `libaom-av1` | [Clone-Image.ps1](Clone-Image.md), [Create-Turnaround.ps1](Create-Turnaround.md) | AVIF images | +| `libwebp` | [Clone-Image.ps1](Clone-Image.md), [Create-Turnaround.ps1](Create-Turnaround.md) | WebP images | + +The filters used (for example `scale`, `crop`, `pad`, `hstack`, `vstack`, `select`, `concat`) are built into ffmpeg. No script needs `libass` or `libfreetype`. ## Environment Variables @@ -42,6 +59,7 @@ Run the task-specific checks only when the task uses the script that needs them: - Stitch-InBetween.ps1: `Get-Command rife-ncnn-vulkan`, `$env:RIFE_HOME` and `$env:NCNN_GPU_ID`. - Clone-Image.ps1 with `-Upscale`: `Get-Command upscayl-bin`, `$env:UPSCAYL_HOME` and `$env:NCNN_GPU_ID`. +- Encoder checks, only for the task that needs the encoder (see the table above). For example, before an MP3 extraction: `ffmpeg -hide_banner -encoders | Select-String libmp3lame`. A missing encoder stops only the task that needs it. If a core check fails, or a check needed by the current task fails, **stop**. Tell the user exactly what is missing and point to [index.md](index.md) (prerequisites), [RIFE.md](RIFE.md) or [Upscalers.md](Upscalers.md). Do not install software or change environment variables without the user's approval. A missing optional tool must not block unrelated tasks such as clipping. @@ -77,8 +95,8 @@ pwsh -NoProfile -File "C:\path\to\Video Processing Scripts\Create-Clip.ps1" -Vid | Form | Meaning | | --- | --- | - | `start-end` | Frames from `start` to `end`, e.g. `100-200` | - | `N` | Frames 0 to `N`, not only frame `N` | + | `start-end` | Frames from `start` to `end`, e.g. `100-200`. Both ends must be inside the video. A reversed range or an end past the last frame is rejected with exit code `1`. | + | `N` | Frames 0 to `N`, not only frame `N`. A number past the last frame is clamped to the last frame. | | `-N` | The last `N` frames. `-1` is the last frame. | | `%` | The last frame index. Alone it selects only the last frame. In a range, e.g. `10-%`, it is the end of the range. | | `-%` | Not supported. Rejected with exit code `1`. |