File size: 856 Bytes
48c2af7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <#
Add the repository's local ffmpeg 'bin' folder to the PATH for the current PowerShell session.
Usage:
.\add_ffmpeg_path.ps1
This does not modify the system PATH permanently; it only updates PATH for the running session.
#>
try {
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
# repo root is one level up from scripts folder
$repoRoot = Resolve-Path (Join-Path $scriptDir "..")
$ffmpegBin = Join-Path $repoRoot "ffmpeg-8.0-essentials_build\bin"
if (Test-Path $ffmpegBin) {
# Prepend so local binary is preferred
$env:PATH = "$ffmpegBin;$env:PATH"
Write-Host "Added local ffmpeg bin to PATH: $ffmpegBin"
exit 0
} else {
Write-Error "ffmpeg bin not found at: $ffmpegBin"
exit 1
}
} catch {
Write-Error "Failed to add ffmpeg to PATH: $_"
exit 2
}
|