Traceback (most recent call last):
File "C:\Users\Evan\Desktop\Gamble\main.py", line 159, in <module>
main()
File "C:\Users\Evan\Desktop\Gamble\main.py", line 128, in main
link = create_clip(count, "WITHDRAW", root)
File "C:\Users\Evan\Desktop\Gamble\main.py", line 53, in create_clip
new = video.subclip(int(frame / 60 - 5), int(frame / 60 + 5))
File "C:\Users\Evan\anaconda3\envs\F\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Users\Evan\anaconda3\envs\F\lib\site-packages\moviepy\decorators.py", line 79, in wrapper
names = inspect.getfullargspec(func).args
NameError: name 'func' is not defined
我没有更改包中的任何内容,也无法在网上找到任何与此相关的内容,导致此错误的代码是
with VideoFileClip(root) as video:
new = video.subclip(int(frame / 60 - 5), int(frame / 60 + 5))
new.write_videofile(f'{root.split(".")[0]}/{claim}{str(datetime.timedelta(seconds=int(frame / 60)))}', audio_codec='aac')
最佳答案
看起来他们接受了一个破坏代码的 PR。我设法通过进入decorators.py并将“func”的任何实例更改为“f”来修复它
关于python - moviepy subclip 函数中的名称错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72146529/