Skip to content

Instantly share code, notes, and snippets.

@next-door-nate
Last active May 18, 2023 21:00
Show Gist options
  • Save next-door-nate/b026026a69053089413ac3b000c08ae0 to your computer and use it in GitHub Desktop.
Save next-door-nate/b026026a69053089413ac3b000c08ae0 to your computer and use it in GitHub Desktop.
Handy ffmpeg commands

Decent web optimization

ffmpeg -i input.mov -vcodec libx264 -vf format=yuv420p output.mp4

Scale

ffmpeg -i input.mov -s 1600x1600 -c:a copy output.mov

Crop (5px from all sides)

ffmpeg -i input.mp4 -filter:v "crop=in_w-2*5:in_h-2*5" output.mp4

Trim video length

ffmpeg -ss 00:00:00 -to 00:00:05 -i input.mp4 -c copy output.mp4

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