Last active
October 24, 2025 22:32
-
Star
(473)
You must be signed in to star a gist -
Fork
(79)
You must be signed in to fork a gist
-
-
Save lukehedger/277d136f68b028e22bed to your computer and use it in GitHub Desktop.
Compress mp4 using 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
| $ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |
./ffmpeg -i input.mp4 -c:v libx265 -preset ultrafast -crf 28 -c:a aac -b:a 250k output.mp4This is better for h265, it's fast and should reduce the file size by 50-70% if you want better video, change the ultrafast to fast or change the -crf to a lower number like 24
If you want to change from 4K to 1080P, add
-s 1920x1080after the-i input.mp4
h256 does not seem to work in ios safari
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Agreed, from the aspect of learning.