python视频提取音频
代码如下:
from moviepy.editor import VideoFileClip # ,AudioFileClip,afx
video = VideoFileClip(“Why Don’t We-What Am I.mp4”)
audio = video.audio
audio.write_audiofile(‘what am I.mp3’)
代码如下:
from moviepy.editor import VideoFileClip # ,AudioFileClip,afx
video = VideoFileClip(“Why Don’t We-What Am I.mp4”)
audio = video.audio
audio.write_audiofile(‘what am I.mp3’)