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:
1 parent
cf41fb0ce5
commit
1227c6e153
13 files changed
+100
-86
No files matched your search
@@ -10,8 +10,9 @@ Sources carrying a `.skip` marker keep that marker last: `P01.skip.mp4` becomes
|
||||
- **`-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"`)
|
||||
- `-N`: Clip last N frames (e.g., `"-10"`)
|
||||
- `%`: Represents the last frame index; can be used alone or in ranges (e.g., `"%"`, `"10-%"`, `"-%"`)
|
||||
- `-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`
|
||||
- `all`: Clip all frames (same as `"0-%"`)
|
||||
- **`-Suffix`** (optional): Text inserted into the derived target name before the file extension. Defaults to `-Clip`, so `P01.mp4` becomes `P01-Clip.mp4`. Include any separator you want, such as the leading `-`. Must not be empty, because an empty suffix would produce a target with the same name as the source. For example, `-Suffix "-Clip-Shot-1"` turns `P01.mp4` into `P01-Clip-Shot-1.mp4`.
|
||||
- **Extra parameters**: Any additional parameters accepted by `Clone-Video.ps1` (e.g. `-Size`, `-FPS`, `-NoAudio`, `-Audio`, `-CRF`, `-Metadata`, `-Reverse`, `-LTX`) are forwarded directly. The parameters `-Video`, `-Frames`, `-Suffix` and `-Target` are handled by this script and must not be repeated.
|
||||
|
||||
Reference in new issue
Block a user