ethman / slakh-utils

Utilities for interfacing with Slakh2100
MIT License
59 stars 15 forks source link

I can't convert to WAV #13

Closed carletes124 closed 4 years ago

carletes124 commented 4 years ago

Hello,

I have installed the requirements and when executing the code I get this error. I don't understand why, can someone please help me?

Thank you

(slakh) C:\Users\Charlie>python C:/Users/Charlie/Desktop/TFM/slakh-utils-master/conversion/flac_converter.py -i E:/DATASETS/Slakh2100/slakh2100_flac/test -o E:/DATASETS/Slakh2100_wav/slakh2100_flac/test -c False Traceback (most recent call last): File "C:/Users/Charlie/Desktop/TFM/slakh-utils-master/conversion/flac_converter.py", line 206, in _apply_ffmpeg(args.input_dir, args.output_dir, args.compress, args.start, File "C:/Users/Charlie/Desktop/TFM/slakh-utils-master/conversion/flac_converter.py", line 111, in _apply_ffmpeg pool.map(_apply_convert_dir, track_directories) File "C:\Users\Charlie\anaconda3\envs\slakh\lib\multiprocessing\pool.py", line 364, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "C:\Users\Charlie\anaconda3\envs\slakh\lib\multiprocessing\pool.py", line 771, in get raise self._value File "C:\Users\Charlie\anaconda3\envs\slakh\lib\multiprocessing\pool.py", line 125, in worker result = (True, func(*args, *kwds)) File "C:\Users\Charlie\anaconda3\envs\slakh\lib\multiprocessing\pool.py", line 48, in mapstar return list(map(args)) File "C:/Users/Charlie/Desktop/TFM/slakh-utils-master/conversion/flac_converter.py", line 108, in _apply_convert_dir _convert_folder(in_track_dir, mix_name, output_dir, File "C:/Users/Charlie/Desktop/TFM/slakh-utils-master/conversion/flac_converter.py", line 85, in _convert_folder ffmpeg_func(in_mix_path, out_track_dir) File "C:/Users/Charlie/Desktop/TFM/slakh-utils-master/conversion/flac_converter.py", line 45, in _flac_to_wav ffmpeg.input(input_path).output(output_path).run_async(overwrite_output=not verbose) File "C:\Users\Charlie\anaconda3\envs\slakh\lib\site-packages\ffmpeg_run.py", line 284, in run_async return subprocess.Popen( File "C:\Users\Charlie\anaconda3\envs\slakh\lib\subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Charlie\anaconda3\envs\slakh\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

carletes124 commented 4 years ago

The packages I have are as follows:

absl-py 0.10.0 alabaster 0.7.12 argh 0.26.2 astroid 2.4.2 astunparse 1.6.3 async-generator 1.10 atomicwrites 1.4.0 attrs 20.2.0 audioread 2.1.8 autopep8 1.5.4 Babel 2.8.0 backcall 0.2.0 backports.functools-lru-cache 1.6.1 bcrypt 3.2.0 bleach 3.2.1 brotlipy 0.7.0 bz2file 0.98 cachetools 4.1.1 certifi 2020.6.20 cffi 1.14.3 chardet 3.0.4 cloudpickle 1.3.0 colorama 0.4.3 cryptography 3.1.1 decorator 4.4.2 defusedxml 0.6.0 diff-match-patch 20200713 dill 0.3.2 dm-sonnet 2.0.0 dm-tree 0.1.5 docutils 0.16 dopamine-rl 3.0.1 entrypoints 0.3 ffmpeg-python 0.2.0 flake8 3.8.4 future 0.18.2 gast 0.3.3 gin-config 0.3.0 google-api-core 1.22.2 google-api-python-client 1.11.0 google-auth 1.21.1 google-auth-httplib2 0.0.4 google-auth-oauthlib 0.4.1 google-pasta 0.2.0 googleapis-common-protos 1.52.0 grpcio 1.32.0 gunicorn 20.0.4 gym 0.17.2 h5py 2.10.0 httplib2 0.18.1 idna 2.10 imagesize 1.2.0 importlib-metadata 2.0.0 intervaltree 3.0.2 ipykernel 5.3.4 ipython 7.18.1 ipython-genutils 0.2.0 isort 5.6.2 jedi 0.17.1 Jinja2 2.11.2 joblib 0.17.0 jsonschema 3.2.0 jupyter-client 6.1.7 jupyter-core 4.6.3 jupyterlab-pygments 0.1.2 Keras 2.4.3 Keras-Preprocessing 1.1.2 keyring 21.4.0 kfac 0.2.2 lazy-object-proxy 1.4.3 librosa 0.7.2 llvmlite 0.32.1 loguru 0.5.3 magenta 2.1.2 Markdown 3.2.2 MarkupSafe 1.1.1 mccabe 0.6.1 mesh-tensorflow 0.1.16 mido 1.2.6 mir-eval 0.6 mistune 0.8.4 nbclient 0.5.0 nbconvert 6.0.7 nbformat 5.0.7 nest-asyncio 1.4.1 note-seq 0.0.1 numba 0.49.1 numpy 1.18.5 numpydoc 1.1.0 oauth2client 4.1.3 oauthlib 3.1.0 opencv-python 4.4.0.42 opt-einsum 3.3.0 packaging 20.4 pandocfilters 1.4.2 paramiko 2.7.2 parso 0.7.0 pathtools 0.1.2 pexpect 4.8.0 pickleshare 0.7.5 pip 20.2.3 pluggy 0.13.1 pretty-midi 0.2.9 promise 2.3 prompt-toolkit 3.0.7 protobuf 3.13.0 psutil 5.7.2 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycodestyle 2.6.0 pycparser 2.20 pydocstyle 5.1.1 pyflakes 2.2.0 pyglet 1.5.0 Pygments 2.7.1 pygtrie 2.3.3 pylint 2.6.0 PyNaCl 1.4.0 pyOpenSSL 19.1.0 pyparsing 2.4.7 pypng 0.0.20 PyQt5 5.12.3 PyQt5-sip 4.19.18 PyQtWebEngine 5.12.1 pyrsistent 0.17.3 PySocks 1.7.1 PySoundFile 0.9.0.post1 python-dateutil 2.8.1 python-jsonrpc-server 0.4.0 python-language-server 0.35.1 python-rtmidi 1.1.2 pytz 2020.1 pywin32 227 pywin32-ctypes 0.2.0 PyYAML 5.3.1 pyzmq 19.0.2 QDarkStyle 2.8.1 QtAwesome 1.0.1 qtconsole 4.7.7 QtPy 1.9.0 requests 2.24.0 requests-oauthlib 1.3.0 resampy 0.2.2 rope 0.18.0 rsa 4.6 Rtree 0.9.4 scikit-learn 0.23.2 scipy 1.4.1 setuptools 49.6.0.post20201009 six 1.15.0 sk-video 1.1.10 snowballstemmer 2.0.0 sortedcontainers 2.2.2 SoundFile 0.10.3.post1 sox 1.4.0 Sphinx 3.2.1 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 1.0.3 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.4 spyder 4.1.5 spyder-kernels 1.9.4 stempeg 0.1.8 tabulate 0.8.7 tensor2tensor 1.15.7 tensorboard 2.3.0 tensorboard-plugin-wit 1.7.0 tensorflow 2.3.0 tensorflow-addons 0.11.2 tensorflow-datasets 3.2.1 tensorflow-estimator 2.3.0 tensorflow-gan 2.0.0 tensorflow-hub 0.9.0 tensorflow-metadata 0.24.0 tensorflow-probability 0.11.0 termcolor 1.1.0 testpath 0.4.4 tf-slim 1.1.0 threadpoolctl 2.1.0 toml 0.10.1 tornado 6.0.4 traitlets 5.0.4 typeguard 2.9.1 ujson 4.0.1 uritemplate 3.0.1 urllib3 1.25.10 watchdog 0.10.3 wcwidth 0.2.5 webencodings 0.5.1 Werkzeug 1.0.1 wheel 0.35.1 win-inet-pton 1.1.0 win32-setctime 1.0.3 wincertstore 0.2 wrapt 1.12.1 yapf 0.30.0 zipp 3.3.0

ethman commented 4 years ago

Hey! Thanks for checking the project.

Because the error message is upset about a path, the first few places I would look to solve your problem are to making sure all of your paths are correct. In order, these are the things I would look into:

  1. Are you calling the script correctly? Here's how this script expects the command line arguments to look:
    $ python flac_converter.py -i /path/to/flac/Slakh2100 -o /output/path/Slakh2100_wav -c False

    Do you have an -i flag that points to the place where you downloaded Slakh2100?, is there an -o flag that exists where the output will go?

I think this is the issue you're seeing. But if it's not try this:

  1. Once you've double checked those two paths then I would make sure you have ffmpeg called correctly. Here's the website for ffmpeg. Once it's installed, make sure you can call it from the command line, and then maybe try opening a python terminal and calling it using sub process.

So, on my machine, I have ffmpeg and calling it the output looks like this:

$ (base) Ethans-MacBook-Pro:~ ethanmanilow$ ffmpeg
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
[Lots more omitted info]

Note that your output will look slightly different because your on Windows.

Whereas when I type in something fake like fffmpeg (notice three f's), I get output like this:

(base) Ethans-MacBook-Pro:~ ethanmanilow$ fffmpeg
-bash: fffmpeg: command not found

You want to make sure your output doesn't say command not found.

Then I can make sure python can call ffmpeg like this:

(base) Ethans-MacBook-Pro:~ ethanmanilow$ python
Python 3.7.6 (default, Jan  8 2020, 13:42:34) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.run('ffmpeg')
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers

This should be the same output as if I called it from the command line above.

Let me know if that helps!

carletes124 commented 4 years ago

Thank you!!!!

My problem was that i didnt install ffmpeg on windows.

ethman commented 4 years ago

I'm glad it solved your issue. Feel free to close this at your convenience .