From 9cbe54d8d3ea1b149ac960a95beaed45d93951c3 Mon Sep 17 00:00:00 2001 From: Claude Toupin Date: Sun, 7 Jun 2026 21:16:06 -0400 Subject: [PATCH] Add NoAudio and CRF parameters to re-encode detection logic and update parameter documentation to clarify when re-encoding is forced --- Clone-Video.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Clone-Video.ps1 b/Clone-Video.ps1 index 73a322d..4ec12e9 100644 --- a/Clone-Video.ps1 +++ b/Clone-Video.ps1 @@ -23,10 +23,13 @@ .PARAMETER Size Size of the output video. Uses the input video's size if not specified. Possible values: 480p, 720p, 1080p, HD, 1440p, 2K, 2160p, 4K, or custom size in format "width:height". + Forces a video re-encode, since scaling requires re-encoding. .PARAMETER FPS Frames per second for the output video. Uses the input video's FPS if not specified. + Forces a video re-encode, since changing frame rate requires re-encoding. .PARAMETER NoAudio When present, excludes audio from the cloned video. + Forces a video re-encode, since removing the audio stream requires re-muxing the output file. .PARAMETER Audio Path to an alternate audio file to use for the target video. Can be absolute or relative to current directory. When specified, this audio replaces the source video's audio. .PARAMETER CRF @@ -400,7 +403,7 @@ if ($AudioPath) { $ffmpegArgs += @('-i', $AudioPath) } -$needsReencode = $scaleWidth -gt 0 -or $FPS -gt 0 -or $videoCodecMismatch -or $Reverse +$needsReencode = $scaleWidth -gt 0 -or $FPS -gt 0 -or $CRF -ge 0 -or $videoCodecMismatch -or $Reverse -or $NoAudio if ($StartFrame -gt 0 -or $actualEndFrame -lt $maxFrameIndex) { $filterParts = @('select=between(n\,{0}\,{1})' -f $StartFrame, $actualEndFrame)