Crop a centred square with crop=ih:ih
Crop a centred square in FFmpeg 7.1 with crop=ih:ih, which defaults the offset to the centre so you only name the size.
The crop filter takes width, height, then optional x and y. When x and y are left out they default to the centre of the frame, so a square needs only the size, and the input height is already the side of a square that fits a landscape video.
ffmpeg -i input.mp4 -vf "crop=ih:ih" -c:v libx264 -crf 22 -c:a copy square.mp4
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 square.mp41080,1080For a 1920x1080 source the result is 1080x1080, with 420 pixels removed from each side. Here ih is the input height, one of the variables listed in the crop filter documentation. For a portrait source use crop=iw:iw instead, or min(iw\,ih) for both: crop=min(iw\,ih):min(iw\,ih), where the backslash escapes the comma inside a filter chain.
Cropping loses the sides, so a person standing off-centre can be cut out. Add an x value such as crop=ih:ih:0:0 to keep the left edge instead. If you need the whole picture inside a square, use pad rather than crop.