首页 > 解决方案 > 无法将大小数组重塑为形状 MoviePy 边距

问题描述

我正在尝试在 MoviePy 中为我的视频添加边距 - 但每当我尝试这样做时 - 就会出现错误: ValueError: cannot reshape array of size 1045200 into shape (780,1340,3)

我不知道这是什么原因造成的?

这是我添加边距的代码:

    def addMargin(self, vid, type, size, color):
        if type == "border":
            clip_with_margin = vid.margin(size, color=color)
        else:
            clip_with_margin = vid.margin(top=size, bottom=size, color=color)
        return clip_with_margin

标签: pythonmoviepy

解决方案


推荐阅读