diff --git a/Create-ShortClip.ps1 b/Create-ShortClip.ps1 index 0b5be80..314e9eb 100644 --- a/Create-ShortClip.ps1 +++ b/Create-ShortClip.ps1 @@ -541,13 +541,16 @@ try { $croppingOffsets = Get-CroppingOffsets -CroppingSection $croppingSection -TotalFrames $videoInfo.FrameCount -InputWidth $videoInfo.Width -OutputWidth $intermediateWidth -Position $position -Smoothing $smoothing -Speed $speed Write-Host "`nCropping Offsets:" - Write-Host ("Frame".PadRight(10) + "Left Offset") - Write-Host ("-" * 21) + Write-Host ("Frame".PadRight(10) + "Left".PadRight(10) + "Center".PadRight(10) + "Right") + Write-Host ("-" * 40) $previousOffset = $null + $halfWidth = [int]($intermediateWidth / 2) foreach ($frame in ($croppingOffsets.Keys | Sort-Object)) { $currentOffset = $croppingOffsets[$frame] if ($currentOffset -ne $previousOffset) { - Write-Host ("{0,-10}{1}" -f $frame, $currentOffset) + $centerOffset = $currentOffset + $halfWidth + $rightOffset = $currentOffset + $intermediateWidth + Write-Host ("{0,-10}{1,-10}{2,-10}{3}" -f $frame, $currentOffset, $centerOffset, $rightOffset) $previousOffset = $currentOffset } } diff --git a/Update-Video-Processing-Scripts.cmd b/Update-Video-Processing-Scripts.cmd new file mode 100644 index 0000000..91272fe --- /dev/null +++ b/Update-Video-Processing-Scripts.cmd @@ -0,0 +1,52 @@ +@echo off +setlocal + +set "REPO_URL=https://git.gurusushi.dyndns.org/guru/Video-Processing-Scripts.git" +set "BRANCH=main" +set "SCRIPT_DIR=%~dp0" + +cd /d "%SCRIPT_DIR%" +if errorlevel 1 ( + echo Failed to change directory to %SCRIPT_DIR% + exit /b 1 +) + +where git >nul 2>&1 +if errorlevel 1 ( + echo Error: git is not installed or not in PATH. + exit /b 1 +) + +if exist ".git" ( + echo Updating existing repository in %SCRIPT_DIR% + git remote set-url origin "%REPO_URL%" + if errorlevel 1 ( + echo git remote set-url failed. + exit /b 1 + ) + git fetch origin %BRANCH% + if errorlevel 1 ( + echo git fetch failed. + exit /b 1 + ) + git checkout %BRANCH% + if errorlevel 1 ( + echo git checkout failed. + exit /b 1 + ) + git pull --ff-only origin %BRANCH% + if errorlevel 1 ( + echo git pull failed. + exit /b 1 + ) +) else ( + echo Cloning repository into %SCRIPT_DIR% + git clone --branch %BRANCH% "%REPO_URL%" . + if errorlevel 1 ( + echo git clone failed. + exit /b 1 + ) +) + +echo Done. +endlocal