用 ffmpeg scale 滤镜等比缩放视频
把 4K 视频压成 1080p 或缩小竖屏视频,画面比例不变形,一条 ffmpeg 命令完成。
运行 `ffmpeg -i input.mp4 -vf "scale=1280:-2" -c:a copy output.mp4`,即可把视频宽度缩到 1280 像素、高度按比例自动计算。
01命令
命令
$ ffmpeg -i input.mp4 -vf "scale=1280:-2" -c:a copy output.mp402作用说明
手动改分辨率容易出现画面拉伸,而 scale 滤镜支持表达式:scale=1280:-2 中的 -2 表示高度自动按原比例计算(并取偶数,这是多数编码器的要求),因此不会变形。-c:a copy 让音频原样复制,音质和时间轴都不受影响。这是把 4K 视频转成 1080p、或把录屏缩小适配设备的标准做法。
03风险
!注意: 缩小分辨率会永久丢失细节——如果以后还可能用到原始分辨率,请保留原文件。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- FFmpeg Filters Documentation依据: The scale filter accepts width/height expressions; scale=1280:-2 resizes to width 1280 with the height auto-computed preserving aspect ratio.
- Scaling - FFmpeg wiki依据: The wiki documents the scale filter with width/height expressions such as scale=1280:-2 to auto-compute height preserving aspect ratio.
最后验证: 2026-09-19 · 分类: 媒体