2

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?

Akshay Hiremath
  • 950
  • 2
  • 12
  • 34
  • This question is downvoted without any comment or explanation. I would appreciate knowing, how this question could be improved further? – Akshay Hiremath Jan 04 '22 at 02:10

3 Answers3

3

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(.

-1

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.

  • I'm using python modules not direct binaries. Python modules are in the site-packages/ directory. python uses it from there. – Akshay Hiremath Dec 29 '21 at 16:18
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – taylor.2317 Dec 29 '21 at 17:25
-2

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.

Akshay Hiremath
  • 950
  • 2
  • 12
  • 34
  • People who didn't like this answer and downvoted it, could you please comment here on what is missing or could be improved in this answer? I have put forward whatever worked for me with the rational behind it. Happy to improve it further. – Akshay Hiremath Jul 25 '23 at 20:07