使用imageio和Python的帧率太低时,视频为黑色

时间:2018-06-27 16:31:43

标签: python-3.x ffmpeg mp4 python-imageio

我有以下示例代码:

import numpy as np
writer = imageio.get_writer('test.mp4', fps=1)

max = 800
resolution = 256

for idx in range(1, max):
    img = np.zeros((resolution,resolution))
    img[: int((idx / max) * resolution), : int((idx / max) * resolution)] = 255
    img = img.astype(np.uint8)
    writer.append_data(img)

writer.close()

fps == 1的视频只是黑色的

我在这里想念什么?我在文档中看不到任何提示说我无法使fps = 1?

编辑

对于fps >= 10来说似乎不错。

0 个答案:

没有答案
相关问题