Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

youtube-dl in python does not find ffmpeg #18266

Closed
BORRHOMEE opened this issue Nov 21, 2018 · 17 comments
Closed

youtube-dl in python does not find ffmpeg #18266

BORRHOMEE opened this issue Nov 21, 2018 · 17 comments
Labels

Comments

@BORRHOMEE
Copy link

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.11.18. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.11.18

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2018.11.18
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
...
<end of log>

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

@dstftw dstftw closed this Nov 21, 2018
@dstftw dstftw added the incomplete label Nov 21, 2018
@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

Good morning, everyone,
I'm desperately trying to use youtube-dl in python, but youtube-dl can't find ffmpeg:
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2018.11.18
[debug] Python version 3.7.0 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {} when I downloaded it, what should I do?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 21, 2018

ffmpeg must be in $PATH.

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

I put it in path via: os.environ["PATH"] += os.pathsep + path but it still doesn't work.I think I'm doing it wrong.

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

a other idea?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 21, 2018

Read new issue template and provide complete output along with complete source code you are running. There are no telepathists here.

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

os.environ ["PATH"] += os.pathsep +'/Users/.../ffmpeg-20181028-bdfd2e3-macos64-static/bin/ffmpeg'
print(os.getenv('PATH'))
/usr/bin:/bin:/usr/sbin:/sbin:/Users/.../ffmpeg-20181028-bdfd2e3-macos64-static/bin/ffmpeg
from future import unicode_literals
import youtube_dl

ydl_opts = {'verbose': True}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://dai.ly/x5zm3r6'])

[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2018.11.18
[debug] Python version 3.7.0 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[generic] x5zm3r6: Requesting header
[redirect] Following redirect to https://www.dailymotion.com/video/x5zm3r6
[dailymotion] x5zm3r6: Downloading webpage
[dailymotion] x5zm3r6: Downloading metadata JSON
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[debug] Default format spec: best/bestvideo+bestaudio
[debug] Invoking downloader on 'https://proxy-19.nyc.dailymotion.com/sec(x552e80a727be2574089fafd5bf645e0)/p/video/837/841/362148738_mp4_h264_aac_fhd_1.m3u8'
[download] Destination: Bigflo & Oli - Dommage-x5zm3r6.mp4
�[0;31mERROR:�[0m m3u8 download detected but ffmpeg or avconv could not be found.

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

I didn't understand your comment, I'm sorry. I'm new and it's quite difficult for me

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 21, 2018

It must be path to folder with ffmpeg not ffmpeg itself. Alternatively use ffmpeg_location option.

@rautamiekka
Copy link

@rautamiekka rautamiekka commented Nov 21, 2018

I take it you got your build from https://ffmpeg.zeranoe.com/builds/, which does match your path to FFmpeg. You should update, there have been many updates since that build. But that's not the problem here.

You've designated the very complete path to the binary itself, which doesn't work. Take away the trailing ffmpeg (the name of the binary) from the whole path and try again, it should work after that.

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

os.environ ["PATH"] += os.pathsep + '/Utilisateurs/.../ffmpeg-20181028-bdfd2e3-macos64-statique/bin/'
print (os.getenv ('PATH'))
/usr/bin:/bin:/usr/sbin:/sbin:/Utilisateurs/.../ffmpeg-20181028-bdfd2e3-macos64-statique/bin/

ydl_opts = {'verbose': True}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://dai.ly/x5zm3r6'])

[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2018.11.18
[debug] Python version 3.7.0 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[generic] x5zm3r6: Requesting header
[redirect] Following redirect to https://www.dailymotion.com/video/x5zm3r6
[dailymotion] x5zm3r6: Downloading webpage
[dailymotion] x5zm3r6: Downloading metadata JSON
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[dailymotion] x5zm3r6: Downloading m3u8 information
[debug] Default format spec: best/bestvideo+bestaudio
[debug] Invoking downloader on 'https://proxy-19.nyc.dailymotion.com/sec(x552e80a727be2574089fafd5bf645e0)/p/video/837/841/362148738_mp4_h264_aac_fhd_1.m3u8'
[download] Destination: Bigflo & Oli - Dommage-x5zm3r6.mp4
�[0;31mERROR:�[0m m3u8 download detected but ffmpeg or avconv could not be found. Please install one.
Still not, unless I've been wrong again

@rautamiekka
Copy link

@rautamiekka rautamiekka commented Nov 21, 2018

^ Dunno if you need to remove the trailing / as well, but are those ... in the path added by you without post-editing the code ? Dunno how Mac's Bash deals with various things, but I doubt that works as a wildcard of sorts; I'm doubting you could use any in Python paths ...

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 21, 2018

actually there is not the last slash at the end when the path is given in consol, but even when I remove the last slash it still doesn't pass

@Hrxn
Copy link

@Hrxn Hrxn commented Nov 22, 2018

os.environ["PATH"] += os.pathsep + path

Not sure what you are trying to do here actually. os.pathsep is the property as given by Python? If yes, then it returns either / or \. But that is not how you separate multiple paths inside your PATH var, that would be either : or ;, according to platform. It should be : on Unixoids.

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 22, 2018

I think I'm the one who misuses ffmpeg with python, I can't figure out how to do it.
If I'm not mistaken during the installation we get a binary file of ffmpeg that we must place so that python can find it and use it for example with youtube-dl?
But however I try to place ffmpeg in path python, it still doesn't find it, so I'm definitely doing it wrong.
Someone could enlighten me on the right way to do it, or a way to make python find it,...?

@Hrxn
Copy link

@Hrxn Hrxn commented Nov 23, 2018

You can put the ffmpeg binaries anywhere that is in your PATH, like /usr/bin for example.

@BORRHOMEE
Copy link
Author

@BORRHOMEE BORRHOMEE commented Nov 23, 2018

I use a sudo cp to put it in /usr/bin but it puts me : Operation not permitted

@rautamiekka
Copy link

@rautamiekka rautamiekka commented Nov 27, 2018

I use a sudo cp to put it in /usr/bin but it puts me : Operation not permitted

A few possible reasons for that. I've not made any research on these, so some could be wrong:

  1. You've a chattr -V +i (immutability (filesystem-level write protection flag)) enabled on the folder, which blocks even the root user.
  2. sudoers disallows that. By default on Debian[-based] and Ubuntu[-based] this doesn't happen, and I dunno if that's even possible.
  3. OS protection services like SELinux are blocking access. By default on Debian[-based] and Ubuntu[-based] this doesn't happen.
  4. The folder, or its parent folder, is mounted with ro (read-only) flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.