Fix -Frames negative range calculation to extract last N frames correctly (off-by-one error), add validation to reject invalid '-%' and '-0' formats with exit code 1, change '%' alone to extract single last frame instead of range, remove duplicate last frame from PNG sequence concat list, update Get-LastFrame.ps1 and Get-Frame.ps1 to clamp out-of-range frame indices instead of erroring and improve error messages with inline stderr output, add -y flag and -- separator to ffprobe calls, replace deprecated

This commit is contained in:
guru committed 2026-11-02 06:30:38 -05:00
1 parent cf41fb0ce5
commit 1227c6e153
13 files changed
+100 -86

No files matched your search

+3 -2
View File
@@ -45,8 +45,9 @@ The output container is chosen from the `-Target` extension (`.mp4`, `.webm`, or
- **`-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"`)
- `-N`: Clone last N frames (e.g., `"-10"`)
- `%`: Represents the last frame index; can be used alone or in ranges (e.g., `"%"`, `"10-%"`, `"-%"`)
- `-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`
- `all`: Clone all frames (same as `"0-%"`)
- **`-Sequence`** (optional): Path to PNG file for extracted frame (`.png` extension added if missing)
- **`-Size`** (optional): Size of the output video. Uses the input video's size if not specified. Possible values: `320p`, `384p`, `480p`, `720p`, `900p`, `1080p`, `HD`, `1440p`, `2K`, `2160p`, `4K`, or custom size in format `width:height`. For standard named sizes the output **preserves the source aspect ratio**: the reference height is used as the short-side target and the other dimension is computed from the source AR — landscape/square sources use the reference as the output height (width computed), portrait sources use it as the output width (height computed). Custom sizes (`width:height`) are applied exactly as given. Forces a video re-encode, since scaling requires re-encoding.