Last active
September 14, 2015 09:07
-
-
Save paulmsmith/50e870f8a151667ebd02 to your computer and use it in GitHub Desktop.
ffmpeg compress MP4s and convert to webm - commands
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
# install libvpx and ffmpeg | |
brew install libvpx | |
brew install ffmpeg --with-libvpx | |
# convert a single specific file "input.mp4" to webm "output.webm" | |
ffmpeg -i input.mp4 -c:v libvpx -b:v 1M -c:a libvorbis output.webm | |
# loop all mp4 files in current directory and convert to webm suffixed with "_compressed" | |
for file in *.mp4; do ffmpeg -i "$file" -c:v libvpx -b:v 1M -c:a libvorbis "${file%.mp4}"_compressed.webm; done | |
# compress specific mp4 | |
ffmpeg -i input.mp4 -c:v libx264 -crf 24 -b:v 1M -c:a libvo_aacenc output.mp4 | |
// compress all mp4s in current directory suffixed with "_compressed" | |
for file in *.mp4; do ffmpeg -i "$file" -c:v libx264 -crf 24 -b:v 1M -c:a libvo_aacenc "${file%.mp4}"_compressed.mp4; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment