Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $filelist = Get-ChildItem -path "Z:\<location>\" -filter *.mkv -recurse | Where-Object {$_.DirectoryName -match '<your-regex>'}
- Write-Host $filelist.DirectoryName
- $num = $filelist | measure
- $filecount = $num.count
- $i = 0;
- ForEach ($file in $filelist)
- {
- $i++;
- $oldfile = $file.DirectoryName + "\" + $file.BaseName + $file.Extension;
- $newfile = "Z:\<outlocation>" + $file.BaseName + ".mp4";
- $progress = ($i / $filecount) * 100
- $progress = [Math]::Round($progress,2)
- Clear-Host
- Write-Host -------------------------------------------------------------------------------
- Write-Host Handbrake Batch Encoding
- Write-Host "Processing - $oldfile"
- Write-Host "File $i of $filecount - $progress%"
- Write-Host -------------------------------------------------------------------------------
- Start-Process "C:\Users\<user>\Desktop\HandBrake\HandBrakeCLI.exe" -ArgumentList "-i `"$oldfile`" -o `"$newfile`" -v -O --align-av -e x264 --two-pass -q 20 --vfr --all-audio --subtitle-burned none --all-subtitles -E av_mp4 -B 128 -6 stereo --non-anamorphic --keep-display-aspect -w 720 --subtitle-burned=none --subtitle-default none --no-markers --verbose=0" -Wait -NoNewWindow
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement