Skip to content

Instantly share code, notes, and snippets.

@docPhil99
Last active March 29, 2021 12:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save docPhil99/d79baa2eee07761b71dd56fffe84e692 to your computer and use it in GitHub Desktop.
Save docPhil99/d79baa2eee07761b71dd56fffe84e692 to your computer and use it in GitHub Desktop.
Add bars to video for IGTV

To convert a video to 16x9 or 9x16 by adding black bars use ffmpeg as follows ffmpeg -i film1.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1" film1_bars.mp4

This add bars to the top and bottom, flip both of the 1920:1080 to 1080:1920 for horizontal bars (better for computer monitors, TV etc)

Note IGTV also requires h.264 and a max of 30fps.

Thanks to https://stackoverflow.com/a/46693766/3361398

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