尝试将MP4转换为Python中的MP3时FFMPEG错误
from pytube import YouTube
from moviepy.editor import *
with open('test.txt') as f:
lines = f.readlines()
for x in lines:
yt = YouTube(x)
yt.streams.filter(file_extension='mp4').first().download()
mp4_file = f"{yt.title}.mp4"
mp3_file = f"{yt.title}.mp4"
videoclip = VideoFileClip(mp4_file)
audioclip = videoclip.audio
audioclip.write_audiofile(mp3_file)
audioclip.close()
videoclip.close()
title = f"{yt.author} {yt.title}"
print(title)
尝试使用Pytube和Monypy将下载的MP4从YouTube视频转换为MP3。下载MP4的工作正常,但是当转换部分发生时,我会遇到此错误: https://i.sstatic .net/loxhh.png
尝试更新FFMPEG,但这无济于事。
from pytube import YouTube
from moviepy.editor import *
with open('test.txt') as f:
lines = f.readlines()
for x in lines:
yt = YouTube(x)
yt.streams.filter(file_extension='mp4').first().download()
mp4_file = f"{yt.title}.mp4"
mp3_file = f"{yt.title}.mp4"
videoclip = VideoFileClip(mp4_file)
audioclip = videoclip.audio
audioclip.write_audiofile(mp3_file)
audioclip.close()
videoclip.close()
title = f"{yt.author} {yt.title}"
print(title)
Trying to convert downloaded mp4 from Youtube videos to mp3 using pytube and moviepy. Downloading the mp4's works fine however I run into this error when the conversion part happens: https://i.sstatic.net/loxHh.png
Tried updating ffmpeg, but it didn't help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论