Last active
August 29, 2018 19:53
-
-
Save paivaric/85fd9b3b34bfc584a214bd1168cfd7d1 to your computer and use it in GitHub Desktop.
Compress Files in Batch with FFMPEG
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
# first install FFMPEG | |
brew install ffmpeg $(brew options ffmpeg | grep -vE '\s' | grep -- '--with-' | tr '\n' ' ') | |
# find and compress | |
find . -iname "*.mp4" | xargs -I {} ffmpeg -i {} -vcodec libx264 -crf 40 -acodec aac -threads 0 {}_compressed.mp4 | |
# ignore already compressed | |
find . -type f \( -iname "*.mp4" ! -iname "*compressed*" \) | xargs -I {} ffmpeg -i {} -vcodec libx264 -crf 40 -acodec aac -threads 0 {}_compressed.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment