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




  • 2018-03-08 09:44:12

    前端性能监控:window.performance

    Web Performance API允许网页访问某些函数来测量网页和Web应用程序的性能,包括 Navigation Timing API和高分辨率时间数据。

  • 2018-03-08 09:44:15

    前端性能监控:window.performance

    Web Performance API允许网页访问某些函数来测量网页和Web应用程序的性能,包括 Navigation Timing API和高分辨率时间数据。

  • 2018-03-08 09:47:14

    ES6,Array.fill()函数的用法

    ES6为Array增加了fill()函数,使用制定的元素填充数组,其实就是用默认内容初始化数组。

  • 2018-03-08 09:53:39

    document.readyState

    一个document 的 Document.readyState 属性描述了文档的加载状态。

  • 2018-03-09 02:09:23

    ArrayBuffer:类型化数组

    ArrayBuffer对象、TypedArray对象、DataView对象是JavaScript操作二进制数据的一个接口。这些对象早就存在,属于独立的规格,ES6将它们纳入了ECMAScript规格,并且增加了新的方法。

  • 2018-03-09 11:45:11

    SQL SELECT DISTINCT 语句

    如需从 Company" 列中仅选取唯一不同的值,我们需要使用 SELECT DISTINCT 语句: