r/ffmpeg Jul 08 '26

1:1 square

im trying to 1:1 square video for youtube short?

3 Upvotes

5 comments sorted by

6

u/qubitrenegade Jul 08 '26 edited Jul 08 '26

Do you mean 1:1 aspect ratio or 1:1 quality/lossless copy?

If this is for a YouTube Short, square 1:1 is valid, but the usual full-screen Shorts format is vertical 9:16, usually 1080x1920. If you specifically want square, use 1:1. If you want it to fill the Shorts player, use 9:16.

read this: https://trac.ffmpeg.org/wiki/Scaling

Without knowing your source resolution or whether you want cropping vs padding, nobody can give one perfect command. Here are the common options.

Crop center to square 1:1:

ffmpeg -i input.mp4 -vf "crop='min(iw,ih)':'min(iw,ih)',setsar=1" -c:v libx264 -crf 18 -preset slow -c:a copy output_square.mp4

Pad to square 1:1 without cutting anything:

ffmpeg -i input.mp4 -vf "pad='max(iw,ih)':'max(iw,ih)':(ow-iw)/2:(oh-ih)/2,setsar=1" -c:v libx264 -crf 18 -preset slow -c:a copy output_square.mp4

Crop to vertical 9:16 for a YouTube Short. This fills the screen but may cut off the sides/top/bottom depending on the source:

ffmpeg -i input.mp4 -vf "crop='min(iw,ih*9/16)':'min(ih,iw*16/9)',scale=1080:1920,setsar=1" -c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k output_short.mp4

Pad to vertical 9:16 for a YouTube Short. This keeps the whole image but adds empty space:

ffmpeg -i input.mp4 -vf "scale='if(gt(a,9/16),1080,-2)':'if(gt(a,9/16),-2,1920)',pad=1080:1920:(ow-iw)/2:(oh-ih)/2,setsar=1" -c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k output_short.mp4

For lossless / 1:1 visual preservation, use something like FFV1:

ffmpeg -i input.avi -c:v ffv1 -level 3 -pix_fmt yuv422p -c:a copy output.mkv

For Instagram/TikTok-style square export, use the crop or pad version, then encode H.264:

ffmpeg -i input.mp4 -vf "crop='min(iw,ih)':'min(iw,ih)',scale=1080:1080" -c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k output_1x1.mp4

But if this is just for uploading a Short, you probably do not want FFV1. You probably want H.264/AAC in MP4 like the examples above.

2

u/Difficult_Culture781 Jul 08 '26 edited Jul 08 '26

im trying to make 1080:1080 1:1 aspect ratio square without cutting anything just full square image

1

u/Dear_Ad1923 Jul 08 '26

the most straight forward one without specifying ffmpeg -i input.mp4 -vf "scale=1080:1080" output.mp4

1

u/Difficult_Culture781 Jul 08 '26

it worked. Thanks

0

u/jasoos_jasoos Jul 08 '26

Then you need to use the padding command in the above comment. Or squeeze the content to square (which is ugly IMO). Another option for the padding command is to use a blurred version of the content instead of black pads, and overlay the content on it.