首页 > 解决方案 > FFMPEG Python:遇到具有相同上游标签的多个传出边缘的比例(1920、1080)无;可能需要一个`split`过滤器

问题描述

这是有问题的代码:

for comment in thread['comments']:
        commentClips += fragmentConcat(comment, filePrefix)
        
        staticClip = ffmpeg.input('assets/static.mp4')
        commentClips.append(staticClip
                                .filter('setsar', 1, 1)
                                .filter('scale', 1920, 1080)
                           )
        commentClips.append(staticClip.audio)

此代码生成以下错误:

ValueError: Encountered scale(1920, 1080) <6adb028f8ef5> with multiple outgoing edges with same upstream label None; a `split` filter is probably required

我已尝试仅使用输入的视频部分进行第一次通话(例如staticClip['v'].filter...),并且我已尝试split按照建议使用通话(例如ffmpeg.input(...).split()。没有任何效果。问题是什么,我该如何解决?谢谢。

标签: pythonffmpegffmpeg-python

解决方案


推荐阅读