使用 imageio 和 Python 当帧率太低时视频是黑色的

2024-04-09

我有以下示例代码:

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?

EDIT

For fps >= 10看来还好。


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 imageio 和 Python 当帧率太低时视频是黑色的 的相关文章

随机推荐