ix Get-Frame.ps1 parameter forwarding to use preference variable splatting instead of manual array building, preventing positional binding issues, update Get-FramesRange.ps1 to add -y flag for automatic overwrite of existing PNG files, fix Create-ShortClip.ps1 to skip clearing default Frames directory when -Render is used (frames are input not output) and add null checks before Test-Path in cleanup logic, and update documentation in Create-FullSubtitle.ps1 and Create-ShortClip.ps1 to clarify existing

This commit is contained in:
guru committed 2026-11-01 16:58:24 -05:00
1 parent 373efac4af
commit c79451b373
4 files changed
+12 -9

No files matched your search

+2 -6
View File
@@ -1,7 +1,7 @@
<#
.SYNOPSIS
Extracts a specific frame of a video file to a PNG image using Get-LastFrame.ps1, requiring -Video and -Frame parameters from that script.
The image filename used for the -Image parameter is automatically derived from the -Video filename, with a "-" followed by the "-Frame" value padded with zeros (maximum of 4 digits) inserted before the image file extension (e.g., P01.mp4 for frame 10 becomes P01-0010.png).
The image filename used for the -Image parameter is automatically derived from the -Video filename, with a "-" followed by the "-Frame" value padded with zeros (at least 4 digits, wider numbers are not truncated) inserted before the image file extension (e.g., P01.mp4 for frame 10 becomes P01-0010.png).
.PARAMETER Video
Path to the input video file. Can be absolute or relative to current directory.
.PARAMETER Frame
@@ -73,9 +73,5 @@ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$getLastFrameScript = Join-Path $scriptDir 'Get-LastFrame.ps1'
# Forward common parameters to Get-LastFrame.ps1
$passThrough = @()
if ($PSBoundParameters.ContainsKey('WhatIf')) { $passThrough += '-WhatIf' }
if ($PSBoundParameters.ContainsKey('Confirm')) { $passThrough += '-Confirm' }
& $getLastFrameScript -Video $VideoPath -Image $imagePath -Frame $frameToExtract @passThrough
& $getLastFrameScript -Video $VideoPath -Image $imagePath -Frame $frameToExtract -WhatIf:$WhatIfPreference -Confirm:([bool]$PSBoundParameters['Confirm'])
exit $LASTEXITCODE