python提取视频中的音频
一.安装模块
pip3 install moviepy
二.代码
from moviepy.editor import *
video = VideoFileClip('1.mp4') #视频所在路径
audio = video.audio
audio.write_audiofile('1.mp3') #音频所在路径
pip3 install moviepy
from moviepy.editor import *
video = VideoFileClip('1.mp4') #视频所在路径
audio = video.audio
audio.write_audiofile('1.mp3') #音频所在路径