Created
April 28, 2016 19:49
-
-
Save vasile/35c11a423ff9fd261829fb784f5550a4 to your computer and use it in GitHub Desktop.
Use FFmpeg to resize videos
This file contains 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
# tested on OSX | |
# get FFmpeg: brew install ffmpeg | |
# | |
# resize source movie (-i parameter) to max width 640px and 128k MP3 audio | |
# for crf (constant rate factor) see https://trac.ffmpeg.org/wiki/Encode/H.264 | |
# | |
ffmpeg -i /path/to/source.mp4 \ | |
-vcodec libx264 \ | |
-y -codec:a mp3 -strict -2 -b:a 128k -ar 44100 \ | |
-crf 23 \ | |
-vf scale="'if(gt(iw,640),640,iw)':-1" \ | |
/path/to/destination.mp4 </dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment