安装 moviepy
pip install moviepy
提取视屏中的音频
from moviepy.editor import *
video = VideoFileClip('a.mp4') #导入mp4
audio = video.audio #取音频
audio.write_audiofile('a.mp3') #保存到mp3文件
安装 moviepy
pip install moviepy
提取视屏中的音频
from moviepy.editor import *
video = VideoFileClip('a.mp4') #导入mp4
audio = video.audio #取音频
audio.write_audiofile('a.mp3') #保存到mp3文件