Skip to content

Instantly share code, notes, and snippets.

@pajcho
Created October 5, 2022 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pajcho/33393a87d8ae6f3a00fe3b61cf15e058 to your computer and use it in GitHub Desktop.
Save pajcho/33393a87d8ae6f3a00fe3b61cf15e058 to your computer and use it in GitHub Desktop.
Compress Video Files

Install ffmpeg

  • brew install ffmpeg

Compress a video

Note that lower CRF values correspond to higher bitrates, and hence produce higher quality videos.

  • ffmpeg -i input.mp4 -c:v libx265 -preset fast -crf 28 output.mp4

Needed on macOS: to preserve compatibility encoding H.265/HEVC for QuickTime

  • ffmpeg -i input.mp4 -c:v libx265 -preset fast -crf 28 -tag:v hvc1 -c:a eac3 -b:a 224k output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment