Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须使用该库将 .mp4 转换为 .wav 以使用 google 的语音转文本 API 获取转录。但是转换一个 40 MB 的文件大约需要 5 分钟。我已经尝试过moviepy和其他库。请建议使用什么。
@PrathameshDoke
我们没有收到错误。只是转换所花费的时间太长了。我们正在使用的代码如下
将moviepy.editor导入为mp
from moviepy.editor import * # 又快又脏
从moviepy.editor导入VideoFileClip
剪辑 = VideoFileClip("trim.5F346E8F-3677-45FF-A1DB-C002F0F07CC1.MOV")
clip.audio.write_audiofile("theaudio.wav")