ffmpeg:宽度不能被2整除(保持比例时) [英] ffmpeg : width not divisible by 2 (when keep proportions)

查看:172
本文介绍了ffmpeg:宽度不能被2整除(保持比例时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试缩小视频的尺寸:

I try to reduce the dimensions of video:

ffmpeg -i input.mp4 -y -acodec aac -ac 2 -ab 160k -vcodec libx264 -vf "scale=-1:'min(720,ih)'" -f mp4 output.mp4

我知道了:

宽度不能被2整除(405x720)

width not divisible by 2 (405x720)

我尝试过:

 -vf "scale=-1:'min(720,ceil(ih/2)*2)'"

做同样的事情,因为我需要保持宽度比例

Go the same because I need to keep width propotions

有什么主意吗?

我已经读过了,没有成功:

I already read that without success:

FFMPEG(libx264)高度不能被2整除"

推荐答案

使用

scale='bitand(oh*dar,65534)':'min(720,ih)'

这将按比例缩放宽度,使其与输出高度成比例,然后将其减小为均匀值.

This will rescale the width proportional to the output height and then reduce it an even value.

这篇关于ffmpeg:宽度不能被2整除(保持比例时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆