Skip to content

Instantly share code, notes, and snippets.

@theoretick
Created December 18, 2016 02:49
Show Gist options
  • Save theoretick/b10211d6ea9ee51752d0afa7fa288a92 to your computer and use it in GitHub Desktop.
Save theoretick/b10211d6ea9ee51752d0afa7fa288a92 to your computer and use it in GitHub Desktop.
osx macOS video conversion with ffmpeg
# ffmpeg cheatsheet for video resizing and modification
## Install ffmpeg (this takes forever
❯ brew install ffmpeg --with-libvpx
# ...
==> make install
🍺 /usr/local/Cellar/ffmpeg/3.2.2: 239 files, 51.7M, built in 8 minutes 31 seconds
## Downscale/upscale to desired dimensions
❯ ffmpeg -i input.mp4 -s 1080x720 output.mp4
## Apply 90 degree clockwise rotation
# 0 = 90CounterCLockwise and Vertical Flip (default)
# 1 = 90Clockwise
# 2 = 90CounterClockwise
# 3 = 90Clockwise and Vertical Flip
# Use -vf "transpose=2,transpose=2" for 180 degrees.
ffmpeg -i input.mov -vf "transpose=1" output.mov
## Apply rotation metadata instead of full re-transposition
ffmpeg -i input.m4v -metadata:s:v rotate="90" -codec copy output.m4v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment