TypeError:“function”对象不是具有ffmpeg的可下标Python

2024-05-16 08:52:28 发布

您现在位置:Python中文网/ 问答频道 /正文

clips = []

def clipFinder(CurrentDir, fileType):
    clips.clear()
    for r,d,f in os.walk(CurrentDir):
        for file in f:
            if fileType in file:
                clips.append(r+file)
    random.shuffle(clips)

def removeVods(r):
    for f in clips:
        if 'vod' in clips:
            os.remove(r+f)

def clipString():
    string = 'intermediate'
    clipList = []
    clipNum = 1
    for f in clips:
        clipList.append(string+str(clipNum)+'.ts'+'|')
        clipNum+=1
    string1 = ''.join(clipList)
    string2 = string1[0:len(string1)-1]
    return string2

def concatFiles():
    clipFinder('***', '.mp4')
    removeVods('***')
    i = 0
    intermediates = []
    for f in clips:
        subprocess.call(['***', '-i', clips[i], '-c', 'copy', '-bsf:v', 'h264_mp4toannexb', '-f', 'mpegts', 'intermediate'+ str(i+1) +'.ts'])
        i += 1 
    clipsLength = len(clips)
    subprocess.call['***', '-i', '"concat:' + clipString() + '"', '-c', 'copy', '-bsf:a 
    aac_adtstoasc', 'output.mp4']

我正在尝试创建一个剪辑串联器,但最后一个子进程调用不会运行,并给出问题中显示的错误。你知道吗

有问题的代码:

subprocess.call(['***', '-i', '"concat:' + clipString() + '"', '-c', 'copy', '-bsf:a aac_adtstoasc', 'output.mp4'])

所有带*的地方都是路径,例如: /大卫电脑/bin/ffmpeg/


Tags: infordefcallfilemp4subprocesscopy