Skip to content

Instantly share code, notes, and snippets.

@alana314
Created October 21, 2020 21:14
Show Gist options
  • Save alana314/5e884a3b8d2dc0ea6f27d000e796a8db to your computer and use it in GitHub Desktop.
Save alana314/5e884a3b8d2dc0ea6f27d000e796a8db to your computer and use it in GitHub Desktop.
Convert and Letterbox video to 1920x1080 29.97 fps with ffmpeg
#!/bin/bash
#convert to 1080 at 29.97fps
#useful for screen capture videos with odd aspect ratios and framerates
#modified from https://superuser.com/questions/891145/ffmpeg-upscale-and-letterbox-a-video
ffmpeg -i input.mov -vf "scale=(iw*sar)*min(1920/(iw*sar)\,1080/ih):ih*min(1920/(iw*sar)\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2, fps=fps=29.97" output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment