# square-to-vertical: commands.log (2026-11-21, ffmpeg 6.1.1) test file: square.mp4 (test pattern, 1080x1080, 6 s, tone) codec_name=h264 width=1080 height=1080 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=30/1 codec_name=aac sample_rate=44100 channels=1 r_frame_rate=0/0 duration=6.000000 size=3677561 ## 1. keep the whole square, centred, bars above and below published: ffmpeg -i square.mp4 -vf "scale=1080:-2,pad=1080:1920:0:(oh-ih)/2" -c:a copy square-centered.mp4 exit=0 time=9.141s codec_name=h264 width=1080 height=1920 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=30/1 codec_name=aac sample_rate=44100 channels=1 r_frame_rate=0/0 duration=6.000000 size=2414317 edge: 720x720 source, no audio published: ffmpeg -i square-720.mp4 -vf "scale=1080:-2,pad=1080:1920:0:(oh-ih)/2" -c:a copy edge-centered-720.mp4 exit=0 time=9.103s codec_name=h264 width=1080 height=1920 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=30/1 duration=4.000000 size=1234117 ## 2. keep the whole square, placed 168 px from the top published: ffmpeg -i square.mp4 -vf "scale=1080:-2,pad=1080:1920:0:168" -c:a copy square-high.mp4 exit=0 time=14.34s codec_name=h264 width=1080 height=1920 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=30/1 codec_name=aac sample_rate=44100 channels=1 r_frame_rate=0/0 duration=6.000000 size=2509151 edge: 720x720 source published: ffmpeg -i square-720.mp4 -vf "scale=1080:-2,pad=1080:1920:0:168" -c:a copy edge-high-720.mp4 exit=0 time=5.163s codec_name=h264 width=1080 height=1920 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=30/1 duration=4.000000 size=1232349 ## 3. fill the frame: crop the middle of the square published: ffmpeg -i square.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" -c:a copy square-cropped.mp4 exit=0 time=8.696s codec_name=h264 width=1080 height=1920 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=30/1 codec_name=aac sample_rate=44100 channels=1 r_frame_rate=0/0 duration=6.000000 size=3471042 edge: 720x720 source published: ffmpeg -i square-720.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920" -c:a copy edge-cropped-720.mp4 exit=0 time=8.234s codec_name=h264 width=1080 height=1920 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=30/1 duration=4.000000 size=1829531 ## arithmetic (1080x1920 frame, combined safe box for Shorts+Reels+TikTok: top 288, bottom 672 -> rows 288..1248) square centred: rows 420..1500; 0 px under the top margin, 252 px under the bottom margin; 828 of 1080 rows clear = 76.7% square 168 px from the top: rows 168..1248; 120 px under the top margin, 0 px under the bottom margin; 960 of 1080 rows clear = 88.9% square at the top margin 288: rows 288..1368; 0 px under the top margin, 120 px under the bottom margin; 960 of 1080 rows clear = 88.9% crop: keeps 607.5 px of 1080 = 56.25% of the width; zoom x1.778 720 source upscaled x1.50 before padding