Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ffprobe command returns non-zero exit status 3221225478 #9

Closed
vinspatel opened this issue Jan 25, 2019 · 9 comments
Closed

Ffprobe command returns non-zero exit status 3221225478 #9

vinspatel opened this issue Jan 25, 2019 · 9 comments

Comments

@vinspatel
Copy link

vinspatel commented Jan 25, 2019

I am running it on anaconda.
It seems to work perfectly on colab. However on anaconda it fails.

The behavior is weird as well. I ran the command on bash and it runs correctly.

I have a loop which runs through all the stem files and it breaks after executing random iterations giving the error stated below.
I believe this could be an multiprocessing issue.
Could it be that that file is already being used by another process?

File "", line 1, in
runfile('C:/Users/w1572032/.spyder-py3/temp.py', wdir='C:/Users/w1572032/.spyder-py3')

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/w1572032/.spyder-py3/temp.py", line 28, in
t = np.copy(track.targets['vocals'].audio.T)

File "C:\ProgramData\Anaconda3\lib\site-packages\musdb\audio_classes.py", line 113, in audio
audio = source.audio

File "C:\ProgramData\Anaconda3\lib\site-packages\musdb\audio_classes.py", line 47, in audio
filename=self.path, stem_id=self.stem_id

File "C:\ProgramData\Anaconda3\lib\site-packages\stempeg\read.py", line 90, in read_stems
FFinfo = FFMPEGInfo(filename)

File "C:\ProgramData\Anaconda3\lib\site-packages\stempeg\read.py", line 19, in init
self.json_info = read_info(self.filename)

File "C:\ProgramData\Anaconda3\lib\site-packages\stempeg\read.py", line 54, in read_info
out = sp.check_output(cmd)

File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 336, in check_output
**kwargs).stdout

File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)

CalledProcessError: Command '['ffprobe', 'C:\Users\w1572032\Desktop\musdb18\train\BigTroubles - Phantom.stem.mp4', '-v', 'error', '-print_format', 'json', '-show_format', '-show_streams']' returned non-zero exit status 3221225478.

@faroit
Copy link
Owner

faroit commented Feb 22, 2019

Sorry for the late reply. did you solve it in the meantime?

@vinspatel
Copy link
Author

No worries. I still haven't solved it yet.
I looked into the inner code of the plugins. It is not creating temp file form ffmpeg execution. This happens with other ffmpeg based libraries as well such as librosa's load throws the same error when ran in loop.
It could be a process management issue in windows i.e., it could be possible that file is still in use or such.

@faroit
Copy link
Owner

faroit commented Mar 12, 2019

are you using python 2.7? Seems that there is a bug in the process call: https://bugs.python.org/issue9400

Otherwise I don't know how to reproduce, could you provide a minimal example where you iterate over the musdb tracks using multiprocessing?

@faroit
Copy link
Owner

faroit commented Mar 13, 2019

I now found a workaround that might help. I added a functionality reuse the Info object, so that ffprobe is only called once if the stream configuration is the same for all tracks (like in musdb)

info = stempeg.Info("first_track.stem.mp4")
for i in range(tracks):
    S, _ = stempeg.read_stems("further_tracks.stem.mp4", info=info)

I will also add this to musdb and update the packages.

@vinspatel
Copy link
Author

vinspatel commented Mar 19, 2019

are you using python 2.7? Seems that there is a bug in the process call: https://bugs.python.org/issue9400

Otherwise I don't know how to reproduce, could you provide a minimal example where you iterate over the musdb tracks using multiprocessing?

Apologies for late reply, I was trying to do this on conda environment in windows:
with necessary packages including libsndfile, ffmpeg, stempeg, musdb, etc.

mus = musdb.DB(root_dir=r"C:\Users\w1572032.INTRANET.002\Desktop\musdb18")
tracks = mus.load_mus_tracks(subsets=['train'])
for i, track in enumerate(tqdm(tracks)):
    t = np.copy(track.targets['vocals'].audio.T)
    xt = np.copy(track.targets['accompaniment'].audio.T)

@faroit
Copy link
Owner

faroit commented Mar 19, 2019

but was this python 2.7 or 3?

and what do you think about the workaround?

@vinspatel
Copy link
Author

vinspatel commented Mar 19, 2019

I was using python 3.7.2 in specific.
I will test it on the updated library and will let you know by tomorrow.
Thanks a lot for your reply.

@vinspatel
Copy link
Author

I have tested the updated library on musdb tracks and it works.
Thanks

@faroit
Copy link
Owner

faroit commented Mar 23, 2019

That's great! Thanks for your feedback. I will update musdb as well in the coming days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants