Skip to content

Instantly share code, notes, and snippets.

@JTBrinkmann
Created April 20, 2020 13:25
Show Gist options
  • Save JTBrinkmann/7ec0f9039e71a33243890af486ae6251 to your computer and use it in GitHub Desktop.
Save JTBrinkmann/7ec0f9039e71a33243890af486ae6251 to your computer and use it in GitHub Desktop.
$inputs = ls -R -F *.mp4
$i = 0
for ($input in $inputs) {
Write-Progress -Activity "Converting Videos" -Status "$(++$i / $inputs.Length)% $($input.Name)" -PercentComplete $($i / $inputs.Length)
$output = Join-Path "..\compressed" ($_ | Resolve-Path -Relative)
if (Test-Path $output) {
echo "already exists: $output"
} else {
mkdir ($output | Split-Path)
ffmpeg -hide_banner -i $input -movflags faststart -r 25 -vf scale=-1:720 -tune stillimage $output
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment