简体   繁体   English

python中的.mp4到.wav转换花费的时间太长

[英].mp4 to .wav conversion in python taking too longer time

I have to use the library to convert the .mp4 to .wav for fetching the transcription using google's speech to text API.我必须使用库将 .mp4 转换为 .wav 以使用谷歌的语音到文本 API 获取转录。 But it is taking approx 5 minutes to convert a 40 MB file.但是转换一个 40 MB 的文件大约需要 5 分钟。 I have tried moviepy and other libraries for the same.我已经尝试过moviepy和其他库。 Please suggest what to use.请建议使用什么。

@PrathameshDoke @PrathameshDoke

we are not getting the error.我们没有收到错误。 Just the time taken in conversion is too longer.只是转换时间太长了。 The code we are using is following我们使用的代码如下

import moviepy.editor as mp将 moviepy.editor 导入为 mp

from moviepy.editor import * # Quick and dirty from moviepy.editor import * # 又快又脏

from moviepy.editor import VideoFileClip从 moviepy.editor 导入 VideoFileClip

clip = VideoFileClip("trim.5F346E8F-3677-45FF-A1DB-C002F0F07CC1.MOV") clip = VideoFileClip("trim.5F346E8F-3677-45FF-A1DB-C002F0F07CC1.MOV")

clip.audio.write_audiofile("theaudio.wav") clip.audio.write_audiofile("theaudio.wav")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM