【FFMPEG】"width / height not divisible by 2" 解决方法

2019-01-26 23:46:08

解决方法一:计算出宽高大小


出现该错误的原因是在于:视频的宽度必须是32的倍数,高度必须是2的倍数


解决方法:


if (screen_width % 32 != 0)

{

screen_width = screen_width / 32 * 32;

}

 

if (screen_height % 2 != 0)

{

screen_height = screen_height / 2 * 2;

}


解决方法二:  scale="854:-2"    https://ffmpeg.org/

Instead of

'scale=-2:min(1080\,ih)'

use

'scale=-2:min(1080\,if(mod(ih\,2)\,ih-1\,ih))'

It will check if ih is divisible by 2, and if not, it will decrease it by 1.




  • 2017-12-25 15:53:15

    MongoDB3.4版本配置详解

    配置文件方面,mongod和mongos有很多相同之处,下文中如有区别之处将会特别指出。 在一个节点上,通常同时启动mongod和mongos进程是正常的,他们之间不存在资源竞争,但是为了避免冲突,我们希望它们使用各自的配置文件,比如mongod.conf、mongos.conf;mongodb的某些平台下的安装包中没有自带配置文件,需要开发者自己创建。

  • 2018-01-01 10:50:49

    仿QQ长按弹出功能菜单

    android app普遍常用的弹出上下文菜单是列表式的。QQ列表,在上方弹出冒泡效果菜单,如图