Akshay Hiremath
Akshay Hiremath

Reputation: 1105

python modules ffmpeg and ffprobe are installed but youtube-dl not able to find

I'm using python 3.8 on MacOS Big Sur

I installed python module package for youtube-dl with

pip3 install -upgrade youtube-dl

I wanted to do post processing on the content downloaded so I installed python packages ffprobe and ffmpeg.

pip3 install ffprobe
Collecting ffprobe
  Downloading https://files.pythonhosted.org/packages/95/9c/adf90d21108d41f611aa921defd2f2e56d3f92724e4b5aa41fae7a9972aa/ffprobe-0.5.zip
Installing collected packages: ffprobe
  Running setup.py install for ffprobe ... done
Successfully installed ffprobe-0.5

pip3 install ffmpeg
Collecting ffmpeg
  Downloading https://files.pythonhosted.org/packages/f0/cc/3b7408b8ecf7c1d20ad480c3eaed7619857bf1054b690226e906fdf14258/ffmpeg-1.4.tar.gz
Installing collected packages: ffmpeg
  Running setup.py install for ffmpeg ... done
Successfully installed ffmpeg-1.4
pip3 list 
Package    Version   
---------- ----------
ffmpeg     1.4       
ffprobe    0.5           
youtube-dl 2021.12.17 

Still it is complaining can't find ffprobe and ffmpeg:

youtube_dl.utils.DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

I see both packages in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/

Trying to figure out what am I doing wrong. Many other answers to similar questions on SFO are suggesting installing these packages in the OS using brew etc. but in my case "I want to do everything through python". So shouldn't just installing python modules be enough?

Upvotes: 2

Views: 7923

Answers (3)

Akshay Hiremath
Akshay Hiremath

Reputation: 1105

Fix: We need to install and keep binary of ffmpeg on our path. For Mac the binary could be downloaded from: ffmpeg.org and added to the path by updating PATH env variable.

Why??

When we install packages using pip/pip3 python just downloads and keeps these as available libraries to use for the python programs. That means with /

pip3 install ffprobe
pip3 install ffmpeg

We will have ffmpeg and ffprobe available as python modules to use in our python code. Library Documentation: https://kkroening.github.io/ffmpeg-python/

What youtube_dl expects is a binary installed on the OS and available on the path.

Also it is important to notice that we use youtube_dl python package and that library expects ffmpeg binary on the path.

Upvotes: -2

sergey khoteev
sergey khoteev

Reputation: 46

I faced the same issue, but it seems that i fixed it with uploading ffmpeg.exe file directly to Scripts (C:\Users\Sergey Khoteev\PycharmProjects\pythonProject\venv\Scripts).

Roadmap is following:

  1. Download original ffmpeg.exe file from https://www.gyan.dev/ffmpeg/builds/. I've dowloaded "ffmpeg-git-full.7z"
  2. Put to together with youtube-dl.exe it's in eg python37\Scripts folder.

Instaling ffmpeg from PyCharm package manager doesn't help, and idk why(.

Upvotes: 3

Kaushik Narayan
Kaushik Narayan

Reputation: 51

Check the Path environment variable. It should contain an entry for the folder that ffprobe and ffmpeg are in.

EDIT: My bad, check this Reddit thread. https://www.reddit.com/r/learnpython/comments/gqhj14/comment/frsq2u3/?utm_source=share&utm_medium=web2x&context=3

It seems you might have to install the command-line tool.

Upvotes: -1

Related Questions