Skip to content

Instantly share code, notes, and snippets.

@uZer
Created October 22, 2021 12:44
Show Gist options
  • Save uZer/36f1d59d8a49892e6c0c3d137449000b to your computer and use it in GitHub Desktop.
Save uZer/36f1d59d8a49892e6c0c3d137449000b to your computer and use it in GitHub Desktop.
Convert vertical video to Instagram story format. Add black borders to ensure format.
# Convert vertical video to Instagram story format.
# Add black borders to ensure format.
ffmpeg \
-i in.avi \
-c:v libx264 -b:v 2333k \
-vf "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,setsar=1" \
-pix_fmt yuv420p -c:a aac \
out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment