Crop a video to vertical 9:16 with ffmpeg
Cut a widescreen video down to a vertical clip for TikTok, Reels, or Shorts using the ffmpeg crop filter.
Run: ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih" output.mp4 — the output is a 9:16 vertical video centered on the original frame.
01Command
Command
$ ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih" output.mp402What it does
The crop filter takes a width and height, and expressions let you compute them from the source: ih*9/16 wide by ih tall gives a 9:16 portrait frame from the middle of the video. Unlike resizing, cropping keeps full resolution and sharpness — it just trims the left and right edges. Change the ratio to 1:1 with crop=ih:ih for square posts.
03Risk
!Warning: Cropping cuts off the sides permanently: action near the left/right edges (like players in sports footage) may be lost — watch the result before posting.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- FFmpeg DocumentationEvidence: Documents -vf (apply a video filtergraph to the output stream) and -i for the input file in the ffmpeg command syntax.
- FFmpeg Filters DocumentationEvidence: Documents the crop filter with expression support, including the ih/iw (input height/width) variables used to build a 9:16 crop rectangle from the source frame.
Last verified: 2026-09-19 · Category: Media