【发布时间】:2022-05-12 07:11:38
【问题描述】:
我正在尝试在 python 中使用 yt-dlp 下载视频。
ydl_opts = {'format': 'bv+ba/b'}
with YoutubeDL(ydl_opts) as ydl:
ydl.download('https://www.reddit.com/r/cats/comments/re37dn/weve_been_feeding_this_stray_for_several_years/')
但我在日志中遇到 FFmpeg 错误
[generic] 1o8t9ollwx481: Requesting header
[redirect] Following redirect to https://www.reddit.com/r/cats/comments/re37dn/weve_been_feeding_this_stray_for_several_years/
[Reddit] re37dn: Downloading JSON metadata
[Reddit] re37dn: Downloading m3u8 information
[Reddit] re37dn: Downloading MPD manifest
[info] 1o8t9ollwx481: Downloading 1 format(s): dash-video_4419291+dash-audio_0_133951
WARNING: You have requested merging of multiple formats but ffmpeg is not installed. The formats won't be merged.
[download] Destination: We’ve been feeding this stray for several years, but she’s lost a lot of weight and I don’t think she would last outside for another winter, so I brought her in. [1o8t9ollwx481].fdash-video_4419291.mp4
[download] 100% of 5.18MiB in 00:00
[download] Destination: We’ve been feeding this stray for several years, but she’s lost a lot of weight and I don’t think she would last outside for another winter, so I brought her in. [1o8t9ollwx481].fdash-audio_0_133951.m4a
[download] 100% of 161.32KiB in 00:00
FFmpeg 通过 pip 安装并添加到 PATH 中。
【问题讨论】:
-
ffmpeg 不会通过 pip 安装。它不是 python 模块。关于如何在此处进行 dl 的说明:ffmpeg.org/download.html
-
我已经通过官网下载并添加了FFpeg到PATH,遗憾的是没有解决问题。 @mechinal_meat
-
好的,但您至少收到了不同的错误消息吗?你能从你的命令行成功调用 ffmpeg 吗?
-
是的,ffmpeg 在命令行中运行良好