Andy's answer と同様に、これは PowerShell と Handbrake のバージョンです
$SourceVideoPath = "C:\Videos\"
$ListOfVideos = Get-ChildItem -path $SourceVideoPath -Filter *.mpg
ForEach ($InputFile in $ListOfVideos){
$rotationFromEXIF = 0
Write-Host "Now processing: $InputFile"
$InputFullName = $InputFile.Fullname
$OutputFullName = $InputFile.DirectoryName + "\output\" + $InputFile;
$rotationFromEXIF = ((& 'C:\Utilities\exiftool.exe' -rotation $InputFullName) -split ": ")[1]
if ($rotationFromEXIF -gt 0){Write-Host "Rotating $rotationFromEXIF degrees"}
(& 'C:\Program Files\HandBrake\HandBrakeCLI.exe' -i $InputFullName -o $OutputFullName --rotate=angle=$rotationFromEXIF)
}