Skip to content

Instantly share code, notes, and snippets.

@charliecm
Last active September 10, 2016 18:55
Show Gist options
  • Save charliecm/af37b4ce38053fb5f6c5 to your computer and use it in GitHub Desktop.
Save charliecm/af37b4ce38053fb5f6c5 to your computer and use it in GitHub Desktop.
Some video cropping snippets using ffmpeg.
# Crop to 1240x768 (tablet) on retina screen
ffmpeg -i input.mp4 -filter:v "crop=2048:1536:256:32" output.mp4
# Center video onto 1920x1080 canvas with white background
ffmpeg -i input.mov -vf "scale=min(iw*1080/ih\,1920):min(1080\,ih*1920/iw),pad=1920:1080:(1920-iw)/2:(1080-ih)/2:color=white" output.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment