Skip to content

Instantly share code, notes, and snippets.

@BrandonRomano
Last active January 21, 2020 13:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrandonRomano/b473fa8ba5941423b2cddc8d2e4178a4 to your computer and use it in GitHub Desktop.
Save BrandonRomano/b473fa8ba5941423b2cddc8d2e4178a4 to your computer and use it in GitHub Desktop.
Optimizing Videos

Depends on ffmpeg (brew install ffmpeg)

Copy & Paste this function into your terminal:

function optimize() {
	ffmpeg -i "$1" -vcodec libx264 -crf 24 "${1%.*}_optimized.${1#*.}"
}

Now run the following:

optimize video.mp4

Which will output video_optimized.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment