faroit / stempeg

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

A loading error in Win System. #30

Closed igo312 closed 4 years ago

igo312 commented 4 years ago

my data has a name format like 'xxxx - xxxx.stem.m64'. but stempeg cannot reconginize the blank space before "-". So it will raise a error said there is no file.

The dataset actually is MUSDB18-7 set

I solve it by following codes which actually deletes the front blank space. But I hope there is a better way to solve it.

index = track_name.index('-')
track_name = track_name[:index-1] + track_name[index:]
faroit commented 4 years ago

Thanks for the report. Can you tell me which line triggers the error?

igo312 commented 4 years ago

here's my tranceback. It is may not stempeg's fault, but I only trace it to this module.

Traceback (most recent call last):
  File "C:/Users/acer/Desktop/LVA-ICA-2018-master/LVA-ICA-2018-master/RGT1/analyze.py", line 17, in <module>
    mus = musdb.DB(root="F:\\MUSDB18-7")
  File "F:\python36\lib\site-packages\musdb\__init__.py", line 110, in __init__
    self.tracks = self.load_mus_tracks(subsets=subsets, split=split)
  File "F:\python36\lib\site-packages\musdb\__init__.py", line 255, in load_mus_tracks
    is_wav=self.is_wav,
  File "F:\python36\lib\site-packages\musdb\audio_classes.py", line 141, in __init__
    super(MultiTrack, self).__init__(path=path, *args, **kwargs)
  File "F:\python36\lib\site-packages\musdb\audio_classes.py", line 53, in __init__
    self.info = stempeg.Info(self.path)
  File "F:\python36\lib\site-packages\stempeg\read.py", line 38, in __init__
    self.json_info = read_info(self.filename)
  File "F:\python36\lib\site-packages\stempeg\read.py", line 93, in read_info
    out = sp.check_output(cmd)
  File "F:\python36\lib\subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "F:\python36\lib\subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "F:\python36\lib\subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "F:\python36\lib\subprocess.py", line 1017, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
igo312 commented 4 years ago

Update: sorry for my poor thought about the problem. Right now, I don't think it's a name format problem. I delete all blank space and use os.path.exits() to check whether the file exists. And I get True from os.path.exits(). but same error infos from stempeg.Info()

>>>os.path.exists(r'F:\MUSDB18-7\AlJames-SchoolboyFacination.stem.mp4')
True

>>>stempeg.Info(r'F:\MUSDB18-7\AlJames-SchoolboyFacination.stem.mp4')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "F:\python36\lib\site-packages\stempeg\read.py", line 38, in __init__
    self.json_info = read_info(self.filename)
  File "F:\python36\lib\site-packages\stempeg\read.py", line 93, in read_info
    out = sp.check_output(cmd)
  File "F:\python36\lib\subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "F:\python36\lib\subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "F:\python36\lib\subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "F:\python36\lib\subprocess.py", line 1017, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
faroit commented 4 years ago

Ok. Can you check if you have ffprobe installed?

igo312 commented 4 years ago

Well,it seems work by downloading ffmpeg.zip add them to env_path. Thank you @faroit !

Attention pip install ffprobe cannot solve problem

faroit commented 4 years ago

Great, that it works

Attention pip install ffprobe cannot solve problem

this is part of the ffmpeg installation. It cannot be installed with pip as pip only installs python software