faroit / stempeg

Python I/O for STEM audio files
https://faroit.github.io/stempeg
MIT License
96 stars 13 forks source link

Is this not working on windows? #4

Closed westside closed 6 years ago

westside commented 6 years ago
import glob, os
import stempeg
import os.path

train_path = "path_to_train/"
os.chdir(train_path)
for file in glob.glob("*.stem.mp4"):
    file_path = train_path + file
    print(os.path.isfile(file_path))
    S, rate = stempeg.read_stems(file_path)

Even isfile returns true, read_stems throws 'FileNotFoundError: [WinError 2] '

faroit commented 6 years ago

can you give more details? have you tried loading a manual absolute file_path?

westside commented 6 years ago

I've tried both absolute and relative path, and nothing works. I put the stem file to the same folder with the python file, but throws same error.

faroit commented 6 years ago

can you give me the full error message, please?

faroit commented 6 years ago

also, did you try using the provided example file: https://github.com/faroit/stempeg/blob/master/tests/data/The%20Easton%20Ellises%20-%20Falcon%2069.stem.mp4 or running the unit tests?

faroit commented 6 years ago

@westside did you managed to solve it?

westside commented 6 years ago

Really sorry for not responding. I just changed the stem file to the other format. Thank you. If I test it, let you know by opening this issue again.

lvbaouu commented 5 years ago

I have this issue on mac. when i tried to S, rate = stempeg.read_stems(file_path). it shows me that [Errno 2] No such file or directory. even when i tried the sample audio provided above and using the absolute file path

faroit commented 5 years ago

@lvbaouu what version of FFMPEG are you using and how did you install it?

lvbaouu commented 5 years ago

i used pip install ffmpeg and it is:

pip show FFMPEG Name: ffmpeg Version: 1.4 Summary: ffmpeg python package url [https://github.com/jiashaokun/ffmpeg] Home-page: https://github.com/jiashaokun/ffmpeg Author: SkeyJIA Author-email: 363604236@qq.com License: MIT Licence Location: /anaconda2/envs/deeplearning/lib/python2.7/site-packages

faroit commented 5 years ago
  1. ffmpeg is not python package. You need to install it via homebrew (osx), apt-get (linux), via conda, if you use anaconda, or manually download it and set the paths
  2. I don't know the pip package you mentioned but it certainly is not the right one
  3. please check the readme
lvbaouu commented 5 years ago

When I downloaded with anaconda and try, I got the following error with the following code : import stempeg S, rate = stempeg.read_stems("/Users/lzhang22/Downloads/The Easton Ellises - Falcon 69.stem.mp4")


CalledProcessError Traceback (most recent call last)

in () ----> 1 S, rate = stempeg.read_stems("/Users/lzhang22/Downloads/The Easton Ellises - Falcon 69.stem.mp4") /anaconda2/envs/deeplearning/lib/python2.7/site-packages/stempeg/read.pyc in read_stems(filename, out_type, stem_id) 89 """ 90 ---> 91 FFinfo = FFMPEGInfo(filename) 92 93 if stem_id is not None: /anaconda2/envs/deeplearning/lib/python2.7/site-packages/stempeg/read.pyc in __init__(self, filename) 17 super(FFMPEGInfo, self).__init__() 18 self.filename = filename ---> 19 self.json_info = read_info(self.filename) 20 21 @property /anaconda2/envs/deeplearning/lib/python2.7/site-packages/stempeg/read.pyc in read_info(filename) 53 ] 54 ---> 55 out = sp.check_output(cmd) 56 info = json.loads(out.decode('utf-8')) 57 return info /anaconda2/envs/deeplearning/lib/python2.7/subprocess.pyc in check_output(*popenargs, **kwargs) 221 if cmd is None: 222 cmd = popenargs[0] --> 223 raise CalledProcessError(retcode, cmd, output=output) 224 return output 225 CalledProcessError: Command '['ffprobe', '/Users/l22/Downloads/The Easton Ellises - Falcon 69.stem.mp4', '-v', 'error', '-print_format', 'json', '-show_format', '-show_streams']' returned non-zero exit status -6
faroit commented 5 years ago

check if you can run ffprobe /Users/lzhang22/Downloads/The Easton Ellises - Falcon 69.stem.mp4 -v error -print_format json -show_format -show_streams in the command line

lvbaouu commented 5 years ago

no. it gives me the following error:

(deeplearning) LPT-010557-PU:~ lzhang22$ ffprobe /Users/lzhang22/Downloads/The Easton Ellises - Falcon 69.stem.mp4 -v error -print_format json -show_format -show_streams

dyld: Library not loaded: @rpath/libx264.138.dylib Referenced from: /anaconda2/envs/deeplearning/bin/ffprobe Reason: image not found Abort trap: 6

faroit commented 5 years ago

I would recommend starting with a fresh anaconda environment. this doesn't seem like the error is caused by stempeg.

lvbaouu commented 5 years ago

i tried. it still gives me the same error

faroit commented 5 years ago

I just checked on my machine, installing miniconda and ffmpeg4 with conda. Works fine here. Check if you didn't install ffmpeg with homebrew. sorry, I can't give support for anaconda or ffmpeg.

lvbaouu commented 5 years ago

it worked on my other computer (but have no storage space the data I want to process) but not the current one. What could have been the issues?