import moviepy.editor
# Replace the parameter with the location of the video
video = moviepy.editor.VideoFileClip("/home/amit/video2.mp4")
audio = video.audio
# Replace the parameter with the location along with filename
audio.write_audiofile("/home/amit/output.mp3")
这是获取此错误的代码:
AttributeError: 'NoneType' object has no attribute 'write_audiofile'
看起来video.audio的值是None,这是python的空值
空值没有任何属性,因此在尝试访问不存在的属性时,您将获得AttributeError
在这种情况下,这可能意味着moviepy无法在video2.mp4中找到音频
您可以通过拨打以下电话获得更多信息:
相关问题 更多 >
编程相关推荐