I am using ytdl to download music through my telegram bot. I am always getting: «error: ffprobe/avprobe and ffmpeg/avconv not found. please install one. «. How to fix this error?
The logs I am getting 👇
2021-10-03 08:21:28.489 | INFO | apscheduler.executors.base_py3:run_coroutine_job:41 — Job «check_rss (trigger: interval[0:10:00], next run at: 2021-10-03 08:31:28 UTC)» executed successfully
On my way
2021-10-03 08:27:40.329 | DEBUG | DaisyX.modules.users:update_user:154 — Users: User 1289524421 updated
2021-10-03 08:27:40.420 | DEBUG | DaisyX.decorator:new_func:118 — [*] wrapped_1 Time: 0.08999991416931152 sec.
[youtube] fm-nXA-K0Dg: Downloading webpage
[youtube] fm-nXA-K0Dg: Downloading player 9fd4fd09
[youtube] fm-nXA-K0Dg: Downloading thumbnail …
[youtube] fm-nXA-K0Dg: Writing thumbnail to: Alan Walker, Sabrina Carpenter & Farruko — On My Way (Lyrics)-fm-nXA-K0Dg.webp
[download] Destination: Alan Walker, Sabrina Carpenter & Farruko — On My Way (Lyrics)-fm-nXA-K0Dg.webm
[download] 0.0% of 3.13MiB at 189.06KiB/s ETA 00:17
[download] 0.1% of 3.13MiB at 549.28KiB/s ETA 00:05
[download] 0.2% of 3.13MiB at 1.22MiB/s ETA 00:02
[download] 0.5% of 3.13MiB at 2.55MiB/s ETA 00:01
[download] 1.0% of 3.13MiB at 1.11MiB/s ETA 00:02
[download] 2.0% of 3.13MiB at 1.27MiB/s ETA 00:02
[download] 4.0% of 3.13MiB at 1.74MiB/s ETA 00:01
[download] 8.0% of 3.13MiB at 2.61MiB/s ETA 00:01
[download] 15.9% of 3.13MiB at 4.19MiB/s ETA 00:00
[download] 31.9% of 3.13MiB at 6.97MiB/s ETA 00:00
[download] 63.9% of 3.13MiB at 11.95MiB/s ETA 00:00
[download] 100.0% of 3.13MiB at 17.11MiB/s ETA 00:00
[download] 100% of 3.13MiB in 00:00
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
2021-10-03 08:27:44.953 | DEBUG | DaisyX.modules.users:update_user:154 — Users: User 1289524421 updated
2021-10-03 08:27:44.954 | DEBUG | DaisyX.modules.filters:check_msg:78 — Running check msg for filters function.
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Summary:
This exception occurs when the get_audio_codec function is called on an instance of FFmpegPostProcessor. This function checks to see if self.probe_available is False and if self.available is also False. If they are both false, this exception is thrown. Those values are both false if probe_basename is None and basename is None. Therefore, ensure at least one of them is not None.
Code to Reproduce the Error (Wrong):
from youtube_dl.postprocessor.ffmpeg import FFmpegPostProcessor from youtube_dl.downloader.common import FileDownloader downloader = FileDownloader(None, {'prefer_ffmpeg':True}) proc = FFmpegPostProcessor(downloader) proc.probe_basename = None proc.basename = None proc.get_audio_codec("")
Error Message:
PostProcessingError Traceback (most recent call last) <ipython-input-14-0d2fc8efecbb> in <module>() 6 proc.probe_basename = None 7 proc.basename = None ----> 8 proc.get_audio_codec("") /usr/local/lib/python3.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py in get_audio_codec(self, path) 164 def get_audio_codec(self, path): 165 if not self.probe_available and not self.available: --> 166 raise PostProcessingError('ffprobe/avprobe and ffmpeg/avconv not found. Please install one.') 167 try: 168 if self.probe_available: PostProcessingError: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Working Version:
from youtube_dl.postprocessor.ffmpeg import FFmpegPostProcessor from youtube_dl.downloader.common import FileDownloader downloader = FileDownloader(None, {'prefer_ffmpeg':True}) proc = FFmpegPostProcessor(downloader) proc.probe_basename = "ffprobe" proc.basename = None proc.get_audio_codec("")
Хочу скачать видео с ютуба и конвертировать его в аудио. Для этого использую библиотеку youtube-dl. В моём коде простой пример из документации . Установленные пакеты: pip install youtube-dl, ffmpeg
from __future__ import unicode_literals
import youtube_dl
import ffmpeg
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '320',
}],
'prefer_ffmpeg': True
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc'])
Результатом скачивается видео и конвертируется в аудиофайл, но при этом возникает очень много ошибок. Что не так?
WARNING: BaW_jenozKc: writing DASH m4a. Only some players support this container. Install ffmpeg or avconv to fix this automatically.
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Traceback (most recent call last):
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 2115, in post_process
files_to_delete, info = pp.run(info)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlpostprocessorffmpeg.py", line 272, in run
filecodec = self.get_audio_codec(path)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlpostprocessorffmpeg.py", line 166, in get_audio_codec
raise PostProcessingError('ffprobe/avprobe and ffmpeg/avconv not found. Please install one.')
youtube_dl.utils.PostProcessingError: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:UsersLeоnidPycharmProjectsconverter2main.py", line 17, in <module>
ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc'])
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 2068, in download
res = self.extract_info(
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 808, in extract_info
return self.__extract_info(url, ie, download, extra_info, process)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 815, in wrapper
return func(self, *args, **kwargs)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 847, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 881, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 1692, in process_video_result
self.process_info(new_info)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 2050, in process_info
self.post_process(filename, info_dict)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 2117, in post_process
self.report_error(e.msg)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 628, in report_error
self.trouble(error_message, tb)
File "C:UsersLeоnidPycharmProjectsconverter2venvlibsite-packagesyoutube_dlYoutubeDL.py", line 598, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
I want to add tags to mp3 converted by youtube-dl & ffmpeg:
youtube-dl -o
‘/Output/qpgTC9MDx1o.mp3’ qpgTC9MDx1o -f bestaudio —extract-audio —metadata-from-title «%(artist)s —
%(title)s» 2>&1
I have this error in the output result:
[youtube] qpgTC9MDx1o: Downloading webpage [youtube] qpgTC9MDx1o:
Extracting video information [youtube] qpgTC9MDx1o: Downloading js
player en_US-vfluGO3jj [youtube] qpgTC9MDx1o: Downloading DASH
manifest [download]
/var/www/vhosts/mp3-y.com/httpdocs/Mp3_Output/quick-mp3.com-JALAL-EL-HAMDAOUI-2007-ARRASSIATES-VOL2-F1P-9CDoxlQ.mp3
has already been downloaded [download] 100% of 13.43MiB WARNING:
qpgTC9MDx1o: writing DASH m4a. Only some players support this
container. Install ffmpeg or avconv to fix this automatically.
[fromtitle] parsed artist: Maroon 5 [fromtitle] parsed title: Animals
ERROR: ffprobe or avprobe not found. Please install one.
14 Answers
Make sure you have the last version for youtube-dl
sudo youtube-dl -U
after that you can solve this problem by installing the missing ffmpeg
on ubuntu and debian:
sudo apt-get install ffmpeg
and macOS use the command:
brew install ffmpeg
brew install ffmpeg
will install what you need and all the dependencies if you are on a Mac.
I know the user asked this for Linux, but I had this issue in Windows (10 64bits) and found little information, so this is how I solved it:
- Download LIBAV, I used libav-11.3-win64.7z. Just copy «avprobe.exe» and all DLLs from «/win64/usr/bin» to where «youtube-dl.exe» is.
In case LIBAV does not help, try with FFMPEG, copying the contents of the «bin» folder to where «youtube-dl.exe» is. That did not help me, but others said it did, so it may worth a try.
Hope this helps someone having the issue in Windows.
On Windows, you can easily install ffmpeg via chocolatey
choco install ffmpeg
There is some confusion when using pip install
in Windows. The instructions talk about a specific folder which has youtube-dl.exe
. There is no such folder if you use pip install
.
The solution is to:
- Download one of the builds from https://ffmpeg.zeranoe.com/
- Extract the zip contents
- Place the contents of the
bin
folder (there are three exe files) in any folder which is apath
in Windows. I personally use Ananconda, so I placed them in/Anaconda/Scripts
, but you could place it in any folder and add that folder to the path.
Compiling the last answers into one:
If you’re on Windows, use chocolatey:
choco install ffmpeg
If you are on Mac, use Brew:
brew install ffmpeg
If you are on a Debian Linux distribution, use apt:
sudo apt-get install ffmpeg
And make sure Youtube-dl is updated:
youtube-dl -U
What worked for me (youtube-dl version 2018.03.03, ffprobe 0.5, no avprobe, 3.4.1-tessus, in Hi-Sierra/iMac) was:
brew install libav
(thanks to marciovsena’s post on GitHub).
I saw elsewhere that libav might be deprecated in the future, but I’ll worry about it when we get there.
You can install them by
sudo apt-get install -y libav-tools
-
Update your version of youtube-dl to the lastest as older version might not support.
pip install --upgrade youtube_dl
-
Install ‘ffmpeg’ and ‘ffprobe’ module
pip install ffmpeg pip install ffprobe
-
If you face the same issue, then download ffmpeg builds and put all the .exe files to Script folder($path: «PythonPython38-32Scripts») (Windows OS only)
On a Mac, install ffmpeg
by downloading it from:
https://ffmpeg.org/download.html
Under «Get packages & executable files/Static Builds for macOS 64-bit».
I downloaded ffmpeg
and ffprobe
.
After download, I extracted the binaries ffmpeg
and ffprobe
, copied them to my path and set permissions:
cp ffmpeg /usr/local/bin/
cp ffprobe /usr/local/bin/
chmod 755 /usr/local/bin/ff*
With brew install ffmpeg
on macOS 10.13 I got the following Error: ffmpeg: no bottle available!
and I was also not able to build ffmpeg on my machine.
on MAC i tried to run brew install ffmpeg
but it didn’t work and got many errors, so i did this and it worked:
1- make sure you have the latest version of youtube-dl
pip install --upgrade youtube_dl
2- go to https://evermeet.cx/ffmpeg/ and download ffmpeg
and ffprobe
3- run which youtube-dl
on Terminal to get the path, where youtube-dl is installed.
you should get something like this : /Library/Frameworks/Python.framework/Versions/3.9/bin/
4- copy the 2 file you downloaded ffmpeg
and ffprobe
to the bin
folder of your path from step 3.
that’s it. you shouldn’t get this error again.
-
update your version of youtube-dl to the lastest as older version might not support palylists.
sudo youtube-dl -U if u installed via .deb
sudo pip install --upgrade youtube_dl via pip
-
use this to download the playlist as an MP3 file
youtube-dl --extract-audio --audio-format mp3 #url_to_playlist
This is an old question. But if you’re using a virtualenv with python, place the contents of the downloaded libav bin
folder in the Scripts
folder of your virtualenv.