'Why doesn't FFmpeg work when using yt-dlp in python script?
I'm trying to download a video using yt-dlp in python.
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/')
But I'm reaching an FFmpeg error in the log
[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 is installed through pip and added in PATH.
Solution 1:[1]
Same error message here, then I realize my yt-dlp was installed by snap. So I just remove it from snap, and install it from pip. Things work fine now.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Zero |