python 将视频转换成音频

安装库

sudo pip install moviepy

代码 index.py

from moviepy.editor import *

video = VideoFileClip('test.mp4')
audio = video.audio
audio.write_audiofile('test.mp3')

运行

python3 index.py

结果

➜  py python3 index.py
MoviePy - Writing audio in test.mp3
MoviePy - Done.     
posted @ 2019-11-26 16:57  taoquns  阅读(3052)  评论(0编辑  收藏  举报