Skip to content

Instantly share code, notes, and snippets.

@mwender
Created January 19, 2024 22:33
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 mwender/c00f2227a1097aab2dd719adf77aded4 to your computer and use it in GitHub Desktop.
Save mwender/c00f2227a1097aab2dd719adf77aded4 to your computer and use it in GitHub Desktop.
[Optimize video files with ffmpeg] One liners for optimizing video files from your command line. #cli
# Reduce the filesize of your .mov and convert to .mp4
#
$ ffmpeg -i input.mov -vcodec h264 output.mp4
# Adjust the resolution of your .mov and convert to .mp4
#
# - The following sets the width to 1280px with the
# height adjusting appropriately.
# - scale={$width}:{$height} - Specify one value and set
# the other to -1 to scale proportionately
#
$ ffmpeg -i input.mov -vf scale=1280:-1 -vcodec h264 output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment