如何使用python将mp4或mpeg4文件转换为mp3?
我看过几个没有成功的库。
答案 0 :(得分:1)
这听起来像是MoviePy的任务。安装它(installation howto)后,可以按以下方式使用它:
import os
from moviepy.editor import *
video = VideoFileClip(os.path.join("path","to","movie.mp4"))
video.audio.write_audiofile(os.path.join("path","to","movie_sound.mp3"))
只需根据需要替换"path","to","movie.mp4"
和"path","to","movie_sound.mp3"
。