Last active
July 26, 2021 20:21
-
-
Save karltaylor/f5e460123a661429148f44230bdf969f to your computer and use it in GitHub Desktop.
Compress MP4 for online content.
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
ffmpeg -i input.mp4 -codec:v libx264 -preset slow -b:v 1000k -maxrate 1500k -bufsize 1500k -vf scale=1080:-1 -threads 0 -codec:a libfdk_aac -b:a 128k output.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To compress all in directory without resizing.
For the single file version.
Flags and Options
-b:v 1000k
sets target bitrate-maxrate 1500k
sets max bitrate (requires-b:v
to be set.)-bufsize 1500k
tells the encoder how often to calculate the average bit rate and check to see if it conforms to the average bit rate specified on the command line (-b:v 1000k
). More info here.