Last active
August 10, 2020 14:27
-
-
Save prodehghan/131229403b729eacdef3259e64d98f63 to your computer and use it in GitHub Desktop.
Converts/compresses all video (.mp4 and .mov) files in current directory to x265
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 characters
if (!(Test-Path -Path "c" -PathType Container)) { | |
mkdir "c" | |
} | |
$files = Get-ChildItem ("*.mp4", "*.mov") | |
$index = 0 | |
$total = $files.Length | |
foreach ($file in $files) { | |
$index++ | |
Write-Host "***** ($index/$total) $($file.Name)" -ForegroundColor Magenta | |
ffmpeg -hide_banner -i $file -map_metadata 0 -movflags use_metadata_tags -c:v libx265 -preset slow -crf 26 -c:a aac -b:a 64k $("c\" + $file.BaseName + ".mp4") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment