CCCPaste

Powershell video resizer FFMPEG

Add-Type -AssemblyName PresentationFramework
Add-Type -AssemblyName System.Windows.Forms

# Déterminer le dossier du script et localiser ffmpeg/ffprobe
try {
    $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
} catch {
    $scriptDir = Get-Location
}
$ffmpegCmd  = Join-Path $scriptDir "ffmpeg.exe"
$ffprobeCmd = Join-Path $scriptDir "ffprobe.exe"

# Vérifier la présence de ffmpeg/ffprobe
if (-not (Test-Path $ffmpegCmd)) {
    [System.Windows.MessageBox]::Show("ffmpeg.exe est introuvable dans le dossier du script.")
    exit
}
if (-not (Test-Path $ffprobeCmd)) {
    [System.Windows.MessageBox]::Show("ffprobe.exe est introuvable dans le dossier du script.")
    exit
}

# Créer la fenêtre WPF
[xml]$xaml = @"