beetbox / audioread

cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python
MIT License
481 stars 108 forks source link

robust way of locating ffmpeg on system #59

Closed TejasBob closed 1 year ago

TejasBob commented 6 years ago

On line 32 in /ffdec.py, you are assuming that ffmpeg is already in system path.

I have a better way of locating ffmpeg. I found it in Moviepy library.

from imageio.plugins.ffmpeg import get_exe -->Imageio helps to get the absolute path of ffmpeg

Hope this helps!

Tejas

sampsyo commented 6 years ago

Hi! Thank you for the suggestion, but we can’t introduce a dependency on Moviepy. If you’re interested, we can try adopting techniques that they use to find the executable ourselves...

TejasBob commented 6 years ago

Hi, I'm not asking for Moviepy as dependancy. I said, I found their method to be robust. You only need to use from imageio.plugins.ffmpeg import get_exe to get path to ffmpeg instead of hard-coding to ffmpeg .

Tejas

sampsyo commented 6 years ago

Sure! But if we include the line from imageio.plugins.ffmpeg import get_exe, that will mean that import audioread will break on people's computers that don't have imageio installed. :cry:

TejasBob commented 6 years ago

Yeah, Maybe. But adding it will make sure that it always works! I faced this issue while using audioread on aws, that's why I created this pull request.

sampsyo commented 6 years ago

I understand! We can't add the dependency, though. If you know where the binary ended up on AWS, however, and can think of a strategy for finding it, I'd totally be interested in adding that!