So I wrote a powershell script that recursively searches all video files above a certain size and then resizes them.
I feel like I'm missing something obvious here...because my script doesn't actually run FFMPEG, it just displays the command to run it on the screen. I'm sure I'll facepalm at the solution.
$SearchPath = "N:\baseball"
$oldVideos = Get-ChildItem -Include @("*.mkv", "*.mov", "*.mpg", "*.wmv", "*.avi") -Path $SearchPath -Recurse | where-object {$_.length -gt 500MB};
Set-Location -Path 'C:\Program Files\ffmpeg\bin';
foreach ($OldVideo in $oldVideos)
{
$outputfolder = "O:\resized"
$oldname = Get-Item $oldvideo | Select-Object -ExpandProperty BaseName
$suffix = "_resized.mp4"
$newname = "$($oldname)_$($suffix)"
$ffmpeg = ".'C:\Program Files\ffmpeg\bin\ffmpeg.exe'"
$arguments = " -i `"$($OldVideo)`" -vf scale=720:trunc(ow/a/2)*2 -c:v libx264 -f mp4 `"$outputfolder\$newname`" -y"
$ffmpeg + $arguments}
Here's the actual output to the screen when I run the script .'C:\Program Files\ffmpeg\bin\ffmpeg.exe' -i "N:\baseball\hitting\067.MOV" -vf scale=720:trunc(ow/a/2)*2 -c:v libx264 -f mp4 "O:\resized\067__resized.mp4" -y
That command should execute (it runs in a command window).
invoke-expressionfor this