【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.




  • 2021-06-08 11:20:55

    安装iohook出错

    no such file or directory, open 'C:\Users\me\AppData\Local\Temp\prebuild.tar.gz'

  • 2021-08-13 23:10:31

    ios framework中的图片如何访问

    特别简单,在主工程设置中,只要resource parse加入那个图片文件夹或者图片目录就可以正常访问了

  • 2021-08-13 23:15:04

    最新iOS APP打包上传到AppStore教程

    作为一名iOS开发者,把辛辛苦苦开发出来的App上传到App Store是件必要的事。但是很多人还是不知道该怎么上传到App Store上,下面就来详细讲解一下具体流程步骤。