Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
Error log:
2021-03-10 07:44:11,114: /home/vishnuji/blog/youtube/views.py:48: DeprecationWarning: Call to deprecated function all (This object can be treated as a list, all() is useless).
2021-03-10 07:44:11,115: stream_all= yt.streams.all()
2021-03-10 07:44:52,483: /home/vishnuji/blog/youtube/views.py:48: DeprecationWarning: Call to deprecated function all (This object can be treated as a list, all() is useless).
2021-03-10 07:44:52,483: stream_all= yt.streams.all()
2021-03-10 07:45:00,251: None
2021-03-10 07:45:00,252: b»ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developersn built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609n configuration: —prefix=/usr —extra-version=0ubuntu0.16.04.1 —build-suffix=-ffmpeg —toolchain=hardened —libdir=/usr/lib/x86_64-linux-gnu —incdir=/usr/include/x86_64-linux-gnu —cc=cc —cxx=g++ —enable-gpl —enable-shared —disable-stripping —disable-decoder=libopenjpeg —disable-decoder=libschroedinger —enable-avresample —enable-avisynth —enable-gnutls —enable-ladspa —enable-libass —enable-libbluray —enable-libbs2b —enable-libcaca —enable-libcdio —enable-libflite —enable-libfontconfig —enable-libfreetype —enable-libfribidi —enable-libgme —enable-libgsm —enable-libmodplug —enable-libmp3lame —enable-libopenjpeg —enable-libopus —enable-libpulse —enable-librtmp —enable-libschroedinger —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libspeex —enable-libssh —enable-libtheora —enable-libtwolame —enable-libvorbis —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx265 —enable-libxvid —enable-libzvbi —enable-openal —enable-opengl —enable-x11grab —enable-libdc1394 —enable-libiec61883 —enable-libzmq —enable-frei0r —enable-libx264 —enable-libopencvn libavutil 54. 31.100 / 54. 31.100n libavcodec 56. 60.100 / 56. 60.100n libavformat 56. 40.101 / 56. 40.101n libavdevice 56. 4.100 / 56. 4.100n libavfilter 5. 40.101 / 5. 40.101n libavresample 2. 1. 0 / 2. 1. 0n libswscale 3. 1.101 / 3. 1.101n libswresample 1. 2.101 / 1. 2.101n libpostproc 53. 3.100 / 53. 3.100nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘/home/vishnuji/Downloads/audio.mp4’:n Metadata:n major_brand : dashn minor_version : 0n compatible_brands: iso6mp41n creation_time : 2020-01-28 19:11:09n Duration: 00:04:39.71, start: 0.000000, bitrate: 129 kb/sn Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 4 kb/s (default)n Metadata:n creation_time : 2020-01-28 19:11:09n handler_name : ISO Media file produced by Google Inc.nInput #1, mov,mp4,m4a,3gp,3g2,mj2, from ‘/home/vishnuji/Downloads/video.mp4’:n Metadata:n major_brand : mp42n minor_version : 0n compatible_brands: isommp42n creation_time : 2020-01-28 19:00:25n Duration: 00:04:39.71, start: 0.000000, bitrate: 655 kb/sn Stream #1:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 640×360 [SAR 1:1 DAR 16:9], 556 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)n Metadata:n creation_time : 2020-01-28 19:00:25n handler_name : ISO Media file produced by Google Inc. Created on: 01/28/2020.n Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)n Metadata:n creation_time : 2020-01-28 19:00:25n handler_name : ISO Media file produced by Google Inc. Created on: 01/28/2020.n[aac @ 0x281d840] The encoder ‘aac’ is experimental but experimental codecs are not enabled, add ‘-strict -2’ if you want to use it.n»
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
-
- background description
- 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:Userssmcco>python -m spleeter separate -i C:UserssmccoMusicPower 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:UserssmccoMusicPower: 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:
The following are 6
code examples of ffmpeg.Error().
You can vote up the ones you like or vote down the ones you don’t like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
ffmpeg
, or try the search function
.
Example #1
def test__run__error(mocker, capture_stdout, capture_stderr): mocker.patch.object(ffmpeg._run, 'compile', return_value=['ffmpeg']) stream = _get_complex_filter_example() with pytest.raises(ffmpeg.Error) as excinfo: out, err = ffmpeg.run( stream, capture_stdout=capture_stdout, capture_stderr=capture_stderr ) assert str(excinfo.value) == 'ffmpeg error (see stderr output for detail)' out = excinfo.value.stdout err = excinfo.value.stderr if capture_stdout: assert out == ''.encode() else: assert out is None if capture_stderr: assert err.decode().startswith('ffmpeg version') else: assert err is None
Example #2
def decode_audio(in_filename, **input_kwargs): try: out, err = (ffmpeg .input(in_filename, **input_kwargs) .output('-', format='s16le', acodec='pcm_s16le', ac=1, ar='16k') .overwrite_output() .run(capture_stdout=True, capture_stderr=True) ) except ffmpeg.Error as e: print(e.stderr, file=sys.stderr) sys.exit(1) return out
Example #3
def generate_thumbnail(in_filename, out_filename, time, width): try: ( ffmpeg .input(in_filename, ss=time) .filter('scale', width, -1) .output(out_filename, vframes=1) .overwrite_output() .run(capture_stdout=True, capture_stderr=True) ) except ffmpeg.Error as e: print(e.stderr.decode(), file=sys.stderr) sys.exit(1)
Example #4
def test__probe__exception(): with pytest.raises(ffmpeg.Error) as excinfo: ffmpeg.probe(BOGUS_INPUT_FILE) assert str(excinfo.value) == 'ffprobe error (see stderr output for detail)' assert 'No such file or directory'.encode() in excinfo.value.stderr
Example #5
def normalize_movie(movie_path, fps="24.00", width=None, height=1080): """ Turn movie in a 1080p movie file (or use resolution given in parameter). """ folder_path = os.path.dirname(movie_path) file_source_name = os.path.basename(movie_path) file_target_name = "%s.mp4" % file_source_name[:-8] file_target_path = os.path.join(folder_path, file_target_name) (w, h) = get_movie_size(movie_path) resize_factor = w / h if width is None: width = math.floor(resize_factor * height) if width % 2 == 1: width = width + 1 if height % 2 == 1: height = height + 1 try: stream = ffmpeg.input(movie_path) stream = stream.output( file_target_path, pix_fmt="yuv420p", format="mp4", r=fps, crf="15", preset="medium", vcodec="libx264", s="%sx%s" % (width, height), ) stream.run(quiet=False, capture_stderr=True) if not has_soundtrack(file_target_path): add_empty_soundtrack(file_target_path) except ffmpeg.Error as exc: from flask import current_app current_app.logger.error(exc.stderr) raise return file_target_path
Example #6
def check_file(filename, error_detect='default', strict_level=0, zero_detect=0, ffmpeg_threads=0): if sys.version_info[0] < 3: filename = filename.decode('utf8') file_lowercase = filename.lower() file_ext = os.path.splitext(file_lowercase)[1][1:] file_size = 'NA' try: file_size = check_size(filename) if zero_detect > 0: check_zeros(filename, CONFIG.zero_detect) if file_ext in PIL_EXTENSIONS: if strict_level in [1, 2]: pil_check(filename) if strict_level in [0, 2]: magick_identify_check(filename) if file_ext in PDF_EXTENSIONS: if strict_level in [1, 2]: pypdf_check(filename) if strict_level in [0, 2]: magick_identify_check(filename) if file_ext in MAGICK_EXTENSIONS: if strict_level in [1, 2]: magick_check(filename) if strict_level in [0, 2]: magick_identify_check(filename) if file_ext in VIDEO_EXTENSIONS: ffmpeg_check(filename, error_detect=error_detect, threads=ffmpeg_threads) # except ffmpeg.Error as e: # # print e.stderr # return False, (filename, str(e), file_size) except Exception as e: # IMHO "Exception" is NOT too broad, io/decode/any problem should be (with details) an image problem return False, (filename, str(e), file_size) return True, (filename, None, file_size)