[How to Solve] ffprobe ‘***: No such file or directory‘

Error reporting solution: ffprobe ‘* * *: no such file or directory’

Explain the error message solution

explain

This blog is used to record the solution to the error reported by ffprobe when I use the splieter open source music separation tool on the Linux server.

Error message

Traceback (most recent call last):
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/spleeter/audio/ffmpeg.py", line 101, in load
    probe = ffmpeg.probe(path)
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/ffmpeg/_probe.py", line 23, in probe
    raise Error('ffprobe', out, err)
ffmpeg._run.Error: ffprobe error (see stderr output for detail)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test_spleeter.py", line 9, in <module>
    separate(sys.argv[1], sys.argv[2], sys.argv[3])
  File "test_spleeter.py", line 7, in separate
    separator.separate_to_file(test_files[0], pre_dir)
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/spleeter/separator.py", line 380, in separate_to_file
    sample_rate=self._sample_rate,
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/spleeter/audio/ffmpeg.py", line 105, in load
    e.stderr.decode()
spleeter.SpleeterError: An error occurs with ffprobe (see ffprobe output below)

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100/56. 31.100
  libavcodec     58. 54.100/58. 54.100
  libavformat    58. 29.100/58. 29.100
  libavdevice    58.  8.100/58.  8.100
  libavfilter     7. 57.100/ 7. 57.100
  libavresample   4.  0.  0/ 4.  0.  0
  libswscale      5.  5.100/ 5.  5.100
  libswresample   3.  5.100/ 3.  5.100
  libpostproc    55.  5.100/55.  5.100
u: No such file or directory

Solution

    1. background description
  1. When I first saw the error message, it was inexplicable. Because there was no problem when testing directly locally, in order to let others try it later, I used the Flask framework to encapsulate Spleeter into a small web page to display it, but this error was reported.

    Search directly online from the beginning ffprobe No such file or directory, The solutions found are basically saying that ffmpeg or ffprobe is not installed, but these two tools have indeed been installed here. After searching for a long time, the problem has not been solved, and then I found a similar error on Spleeter Github Issues #364 .

(base) C:\Users\smcco>python -m spleeter separate -i C:\Users\smcco\Music\Power Rangers Time Force Theme.mp3 -p spleeter:5stems -o output
ERROR:spleeter:An error occurs with ffprobe (see ffprobe output below)

ffprobe version 4.2 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100/56. 31.100
  libavcodec     58. 54.100/58. 54.100
  libavformat    58. 29.100/58. 29.100
  libavdevice    58.  8.100/58.  8.100
  libavfilter     7. 57.100/ 7. 57.100
  libswscale      5.  5.100/ 5.  5.100
  libswresample   3.  5.100/ 3.  5.100
  libpostproc    55.  5.100/55.  5.100
C:\Users\smcco\Music\Power: No such file or directory

No solution was found through this, but I was inspired to think that the absolute path should be used, so I set the path to the absolute path. The error is still not solved, but an error message is changed:

Traceback (most recent call last):
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/spleeter/audio/ffmpeg.py", line 101, in load
    probe = ffmpeg.probe(path)
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/ffmpeg/_probe.py", line 23, in probe
    raise Error('ffprobe', out, err)
ffmpeg._run.Error: ffprobe error (see stderr output for detail)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test_spleeter.py", line 9, in <module>
    separate(sys.argv[1], sys.argv[2], sys.argv[3])
  File "test_spleeter.py", line 7, in separate
    separator.separate_to_file(test_files[0], pre_dir)
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/spleeter/separator.py", line 380, in separate_to_file
    sample_rate=self._sample_rate,
  File "~/miniconda3/envs/spleeter/lib/python3.6/site-packages/spleeter/audio/ffmpeg.py", line 105, in load
    e.stderr.decode()
spleeter.SpleeterError: An error occurs with ffprobe (see ffprobe output below)

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100/56. 31.100
  libavcodec     58. 54.100/58. 54.100
  libavformat    58. 29.100/58. 29.100
  libavdevice    58.  8.100/58.  8.100
  libavfilter     7. 57.100/ 7. 57.100
  libavresample   4.  0.  0/ 4.  0.  0
  libswscale      5.  5.100/ 5.  5.100
  libswresample   3.  5.100/ 3.  5.100
  libpostproc    55.  5.100/55.  5.100
/: Is a directory

At this time, I realized! ! !There is a problem with the file path that I passed in by myself!

Cause analysis

Review the last line of the error message:u: No such file or directory, Which is expressing:There is no file or directory named u. I always thought that u was a specific prefix reported by ffprobe, but only now I discovered that it refers to the file name that was not found.

It turns out that the file name to be separated in my code to Spleeter should be test_files, not test_files[0]. The reason why I used more [0] is because at the beginning, the default test_files represents a list of file names. There is only one time, just take the first one, but the Flask framework just forgot to do it. In the end, a file name was directly assigned to test_files instead of a list.

At this point, if we look at the error message on Spleeter Github Issues #364 , we will find that this error is also caused by a problem with the input file name. There are spaces in the input file name, which directly leads to multiple parameters in the command line. Instead of a complete path.

Concrete steps

Modify the correct file path name passed to Spleeter.

Read More: