Crop video to square

video filters

// what it does

`crop=ih:ih` sets both the output width and height to the input height (`ih`), carving a square out of the frame. With the x/y offsets omitted, crop defaults to centering, so you get the middle square of a landscape video — handy for 1:1 social formats.

// shell

$ ffmpeg -i input.mp4 -vf "crop=ih:ih" output.mp4

// gotcha

On a portrait clip where height exceeds width, `ih` is larger than the frame width and crop errors out; use `crop=iw:iw` there, or `crop='min(iw,ih):min(iw,ih)'` to handle either orientation.