axeldelafosse / stemgen

🎛 Stemgen is a Stem file generator. Convert any track into a Stem and have fun with Traktor.
https://stemgen.dev
MIT License
207 stars 39 forks source link

Error opening input: No such file or directory #33

Closed KayPure closed 1 year ago

KayPure commented 1 year ago

Ive running into following error after the first step is done. looks like there is something wrong with ffmpeg?!

[Done 1/6] converting output/test/htdemucs/test/drums.wav to alac... ffmpeg version 2023-08-23-git-5f5a1ccd04-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 58. 17.100 / 58. 17.100 libavcodec 60. 23.100 / 60. 23.100 libavformat 60. 10.100 / 60. 10.100 libavdevice 60. 2.101 / 60. 2.101 libavfilter 9. 11.100 / 9. 11.100 libswscale 7. 3.100 / 7. 3.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 [in#0 @ 0000014809e77340] Error opening input: No such file or directory Error opening input file output/test/htdemucs/test/drums.wav. Error opening input files: No such file or directory Command '['ffmpeg', '-i', 'output/test/htdemucs/test/drums.wav', '-c:a', 'alac', '-c:v', 'copy', 'output/test/htdemucs/test/drums.m4a']' returned non-zero exit status 4294967294. Done. Cleaning... Traceback (most recent call last): File "C:\stemgen\stemgen.py", line 405, in run() File "C:\stemgen\stemgen.py", line 287, in run clean_dir() File "C:\stemgen\stemgen.py", line 394, in clean_dir shutil.rmtree(os.path.join(DIR, OUTPUT_PATH + "/" + FILE_NAME)) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64qbz5n2kfra8p0\Lib\shutil.py", line 759, in rmtree return _rmtree_unsafe(path, onerror) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64qbz5n2kfra8p0\Lib\shutil.py", line 626, in _rmtree_unsafe onerror(os.rmdir, path, sys.exc_info()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64__qbz5n2kfra8p0\Lib\shutil.py", line 624, in _rmtree_unsafe os.rmdir(path) PermissionError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'C:\stemgen\output/test'

Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird The process cannot access the file because it is used by another process

But there is no other process. Someone can help here?

Greetings

MacTheZazou commented 1 year ago

Same problem...

MacTheZazou commented 1 year ago

@KayPure I think I got it to work by using the binary of ffmpeg built by BtbN : https://www.ffmpeg.org/download.html#build-windows

axeldelafosse commented 1 year ago

Hmm that's weird, I haven't seen this error. How did you install ffmpeg?

chnoma commented 1 year ago

I'm having the same issue here, I think

converting input/wwh.1.flac to alac...
ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.1.1 (GCC) 20230429
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
input/wwh.1.flac: No such file or directory
Command '['ffmpeg', '-i', 'input/wwh.1.flac', '-c:a', 'alac', '-c:v', 'copy', 'input/wwh.1.m4a']' returned non-zero exit status 1.

I'm on EndeavourOS, ffmpeg installed via pacman

chnoma commented 1 year ago

This looks like a problem with ni-stem, rather than stemgen to me, but line 106 of stem.py doesn't do an error check and it ends up finishing cleanly but no output.

chnoma commented 1 year ago

Here's a full log: https://gist.github.com/chnoma/30f12bcc9446150395486a0d37f02522

Nothing is generated in the output folder

EDIT:

it was because I didn't have gpac installed it seems sorry :(

axeldelafosse commented 1 year ago

Hey @chnoma -- glad you found the issue.

The first one was because the input file didn't exists: input/wwh.1.flac: No such file or directory

And yeah the second one was because gpac wasn't installed. On Linux you need to install it yourself. It's in the docs but I'll add a callout to make sure that people don't miss it.

Closing to avoid growing this issue. Please feel free to report a new issue if you still experience one.

JJSSMX commented 9 months ago

i am having similar error:

C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master>python stemgen.py track.wav -d cuda
Using GPU for processing.
Output dir already exists.
Working dir created.
Done.
Extracting bit depth...
bits_per_sample=16
Done.
Extracting sample rate...
sample_rate=48000
Done.
Extracting cover...
Error: The file does not contain any cover art.
Done.
Extracting metadata...
{'title': 'track'}
Creating tags.json...
Done.
Converting to wav and/or downsampling...

Input File     : 'C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output/track/track.wav'
Channels       : 2
Sample Rate    : 48000
Precision      : 16-bit
Duration       : 00:06:19.04 = 18194042 samples ~ 28428.2 CDDA sectors
File Size      : 0
Bit Rate       : 0
Sample Encoding: 16-bit Signed Integer PCM

In:0.00% 00:00:00.00 [00:06:19.04] Out:0     [      |      ]        Clip:0    sox WARN wav: Premature EOF on .wav input file
In:0.00% 00:00:00.00 [00:06:19.04] Out:0     [      |      ]        Clip:0
Done.
Done.
Ready!
Creating a Stem file for track...
Splitting stems...
Using 16-bit model...
Selected model is a bag of 1 models. You will see that many progress bars per track.
Separated tracks will be stored in C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output\track\htdemucs
Separating track C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output\track\track.wav
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\demucs\__main__.py", line 10, in <module>
    main()
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\demucs\separate.py", line 173, in main
    sources = apply_model(model, wav[None], device=args.device, shifts=args.shifts,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\demucs\apply.py", line 187, in apply_model
    sub_model.to(device)
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1160, in to
    return self._apply(convert)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 810, in _apply
    module._apply(fn)
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 810, in _apply
    module._apply(fn)
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 810, in _apply
    module._apply(fn)
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 833, in _apply
    param_applied = fn(param)
                    ^^^^^^^^^
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1158, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\cuda\__init__.py", line 289, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Done.
Creating stem...

[Done 0/6]

converting C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output/track/track.wav to alac...
ffmpeg version 2023-12-28-git-c1340f3439-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 36.100 / 58. 36.100
  libavcodec     60. 36.100 / 60. 36.100
  libavformat    60. 20.100 / 60. 20.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.102 /  9. 14.102
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
[wav @ 000001de7f2cd640] Cannot check for SPDIF
[aist#0:0/pcm_s16le @ 000001de7f2d01c0] Guessed Channel Layout: stereo
Input #0, wav, from 'C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output/track/track.wav':
  Duration: N/A, bitrate: 1411 kb/s
  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> alac (native))
Press [q] to stop, [?] for help
[aost#0:0/alac @ 000001de7f2d1a00] No filtered frames for output stream, trying to initialize anyway.
Output #0, ipod, to 'C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output/track/track.m4a':
  Metadata:
    encoder         : Lavf60.20.100
  Stream #0:0: Audio: alac (alac / 0x63616C61), 44100 Hz, stereo, s16p, 128 kb/s
      Metadata:
        encoder         : Lavc60.36.100 alac
[out#0/ipod @ 000001de7f2d0980] video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[out#0/ipod @ 000001de7f2d0980] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
size=       0kB time=N/A bitrate=N/A speed=N/A

[Done 1/6]

converting C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output/track/htdemucs/track/drums.wav to alac...
ffmpeg version 2023-12-28-git-c1340f3439-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 36.100 / 58. 36.100
  libavcodec     60. 36.100 / 60. 36.100
  libavformat    60. 20.100 / 60. 20.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.102 /  9. 14.102
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
[in#0 @ 0000026f3747f780] Error opening input: No such file or directory
Error opening input file C:\Users\ADMIN\Desktop\PYTHON\stemgen-master\stemgen-master\output/track/htdemucs/track/drums.wav.
Error opening input files: No such file or directory
Command '['ffmpeg', '-i', 'C:\\Users\\ADMIN\\Desktop\\PYTHON\\stemgen-master\\stemgen-master\\output/track/htdemucs/track/drums.wav', '-c:a', 'alac', '-c:v', 'copy', 'C:\\Users\\ADMIN\\Desktop\\PYTHON\\stemgen-master\\stemgen-master\\output/track/htdemucs/track/drums.m4a']' returned non-zero exit status 4294967294.
Done.
Cleaning...
Done.
Success! Have fun :)