Created
April 21, 2015 21:02
-
-
Save mullnerz/7b0123dd0e6a3cee8e2f to your computer and use it in GitHub Desktop.
Revisions
-
mullnerz created this gist
Apr 21, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ # originated from: # https://perfp.wordpress.com/2010/08/25/mass-converting-video-files-using-powershell-and-handbrake/ $outdir = "C:\Temp\convert-avi" [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath $files = Get-Childitem -Recurse -Include "*.avi" foreach ($file in $files) { $subpath = $file.DirectoryName.Replace((Get-Location -PSProvider FileSystem).ProviderPath , "") $destdir = $outdir + $subpath $destname = $destdir + "\" + $file.BaseName + ".mp4" if (!(Test-Path $destdir)) { New-Item $destdir -type directory } if (!(Test-Path $destname)) { & "C:\Program Files\Handbrake\HandBrakeCLI.exe" -i $file -t 1 -c 1 -o $destname --preset "Normal" } }