Skip to content

Instantly share code, notes, and snippets.

@eridal
Created November 21, 2018 17:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eridal/f79b5df27a9af9f123d0d7456cea51af to your computer and use it in GitHub Desktop.
Save eridal/f79b5df27a9af9f123d0d7456cea51af to your computer and use it in GitHub Desktop.
useful command-line things
#!/usr/bin/env bash
from=./images
into=./fixed
quality=60 # percent
find $from -type f -name "*.jpg" | while IFS= read -r jpg; do
mkdir -p "$(
dirname "$into"/"$jpg"
)"
ffmpeg -loglevel quiet -i "$jpg" -q:v $quality "$into"/"$jpg" < /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment