用 ffmpeg 把视频裁成 9:16 竖屏
用 ffmpeg 的 crop 滤镜把横屏视频裁剪成竖屏,适配抖音、快手、Reels、Shorts 等平台。
运行:ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih" output.mp4,输出就是以原画面为中心的 9:16 竖屏视频。
01命令
命令
$ ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih" output.mp402作用说明
crop 滤镜需要指定宽和高,也支持用表达式按原画面计算:宽 ih*9/16、高 ih 正好是 9:16 的竖屏画面,默认取画面中间部分。裁剪不同于缩放,它不降低分辨率、不损失清晰度,只是把左右两边裁掉。想发方形内容,把表达式改成 crop=ih:ih 即可得到 1:1。
03风险
!注意: 裁剪会永久去掉左右两侧的画面:如果主体在边缘(比如体育画面的运动员)可能被裁掉,发出去前先看看效果。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- FFmpeg Documentation依据: Documents -vf (apply a video filtergraph to the output stream) and -i for the input file in the ffmpeg command syntax.
- FFmpeg Filters Documentation依据: 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.
最后验证: 2026-09-19 · 分类: 媒体