Madmom Cannot Find FFMPEG

176 views
Skip to first unread message

Ben Steinbuhler

unread,
Apr 28, 2017, 6:04:54 PM4/28/17
to madmom-users
Hello All!

I'm using madmom for a chord recognition script I'm working on.  I have it working fine locally on my Mac OSX, but when I attempt to use it on my CentOS 6.9 server it is only partially working.  As long as it doesn't need to fall back on FFMPEG it runs fine (with the occasional memory error).  However, if I give it any mp3 file (or wav file that doesn't match madmom's basic wav requirements) I get the error message shown below.  FFMPEG is definitely installed and definitely added to the $PATH variable.  It is in the /usr/bin folder and the user Python is using can run on that folder.

I'm fairly confident the Python and madmom installation is correct since I can get it to work with a basic wav file.  It seems to be that it isn't recognizing the FFMPEG install.  Any thoughts?  Is there a way to specify the path to FFMPEG in a madmom variable so it finds it?

Any help greatly appreciated.  I've been hacking away for about a week.  Thanks so much!

-Ben

[root@s166-62-42-100 Python-2.7.11]# python chord-recognition.py box-of-rain.mp3
Traceback (most recent call last):
  File "chord-recognition.py", line 10, in <module>
    chordArray = chordrec(sys.argv[1])
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/processors.py", line 128, in __call__
    return self.process(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/processors.py", line 336, in process
    data = _process((processor, data, kwargs))
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/processors.py", line 200, in _process
    return process_tuple[0](*process_tuple[1:-1], **process_tuple[-1])
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/processors.py", line 128, in __call__
    return self.process(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/processors.py", line 336, in process
    data = _process((processor, data, kwargs))
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/processors.py", line 200, in _process
    return process_tuple[0](*process_tuple[1:-1], **process_tuple[-1])
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/processors.py", line 128, in __call__
    return self.process(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/audio/signal.py", line 909, in process
    return Signal(data, **args)
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/audio/signal.py", line 743, in __new__
    dtype=dtype)
  File "/usr/local/lib/python2.7/site-packages/madmom-0.15.dev0-py2.7-linux-x86_64.egg/madmom/audio/signal.py", line 631, in load_audio_file
    raise LoadAudioFileError(error)
madmom.audio.signal.LoadAudioFileError: "All attempts to load audio file 'box-of-rain.mp3' failed. Try installing ffmpeg (or avconv on Ubuntu Linux)."

Sebastian Böck

unread,
Apr 29, 2017, 1:31:30 AM4/29/17
to madmom-users
Hi,

On Saturday, 29 April 2017 00:04:54 UTC+2, Ben Steinbuhler wrote:
[...] if I give it any mp3 file (or wav file that doesn't match madmom's basic wav requirements) I get the error message shown below.  FFMPEG is definitely installed and definitely added to the $PATH variable.  It is in the /usr/bin folder and the user Python is using can run on that folder.

I'm fairly confident the Python and madmom installation is correct since I can get it to work with a basic wav file.  It seems to be that it isn't recognizing the FFMPEG install.  Any thoughts?  Is there a way to specify the path to FFMPEG in a madmom variable so it finds it?

If it is, madmom should be able to find and use it. I fear it is not, but you can test by simply calling it, e.g. "ffmpeg box-of-rain.mp3 box-of-rain.wav".

If not, this can have a couple of reasons. Depending on your shell, it might be not enough to set the $PATH variable, but also export it, e.g. "export $PATH".

There's a new (yet unmerged) branch named "https://github.com/CPJKU/madmom/tree/better_ffmpeg_error_msg" which might help to identify the root of the problem. Please try that one if you still encounter problems.

As a last (but definitely working) resort you can always first convert the audio files to .wav.

HTH

Ben Steinbuhler

unread,
Apr 30, 2017, 11:29:25 PM4/30/17
to madmom-users
Hi Sebastian -

Thanks for the quick response.  I appreciate it.

I'd actually already tried everything you suggested.  FFMPEG is definitely installed.  I've installed it a half-dozen different ways and done a full rebuild of the server a few times to try and get a different result.  Even only giving madmom wav files doesn't work.  The box-of-rain.wav file is the only one I can get working.  It was created on my Mac and pulled up.  Any wav files created on FFMPEG on my server don't work, and it won't take any mp3 files either.

In any case, this seems to be an FFMPEG issue, not a madmom one.  I'll keep hacking away here until I figure something out.  It might be the server itself.

And by the way - madmom is super cool.  I'll reach out when I get this thing working to show you how I've used it.

Thanks!
Reply all
Reply to author
Forward
0 new messages