Skip to content

Instantly share code, notes, and snippets.

@positlabs
Last active September 22, 2020 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save positlabs/6bb77a4dc93333c4eb845f25fc4f15bd to your computer and use it in GitHub Desktop.
Save positlabs/6bb77a4dc93333c4eb845f25fc4f15bd to your computer and use it in GitHub Desktop.
Lossless batch encode and resize command
# Batch encode webm files in a directory
for i in *.webm;
do
ffmpeg -y -i $i -b:v 0 -crf 30 -pass 1 -an -f webm /dev/null
ffmpeg -y -i $i -vf scale=640:640:force_original_aspect_ratio=decrease -b:v 0 -crf 30 -pass 2 "_${i}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment