ebb-earl-co / tidal-wave

Waving at the TIDAL music service
Apache License 2.0
38 stars 2 forks source link

Unknown FFmpeg error #62

Closed eevan78 closed 7 months ago

eevan78 commented 7 months ago

Hi, I use a statically linked almost latest full FFmpeg build and tidal-wave on Windows:

c:\Data\Software\Audio\tidal-wave>ffmpeg.exe -version
ffmpeg version 2024-01-24-git-00b288da73-full_build-www.gyan.dev Copyright (c) 2000-2024 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.101 / 58. 36.101
libavcodec     60. 38.100 / 60. 38.100
libavformat    60. 20.100 / 60. 20.100
libavdevice    60.  4.100 / 60.  4.100
libavfilter     9. 17.100 /  9. 17.100
libswscale      7.  6.100 /  7.  6.100
libswresample   4. 13.100 /  4. 13.100
libpostproc    57.  4.100 / 57.  4.100

I was trying to download the following album in HiRes. It goes well up to the track no. 17, and then it fails with the following:

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\ivanp\AppData\Local\pyapp\data\tidal-wave\4771670979927837872\2024.1.12\Lib\site-packages\tidal_wave\__main__.py", line 3, in <module>
    app()

  File "C:\Users\ivanp\AppData\Local\pyapp\data\tidal-wave\4771670979927837872\2024.1.12\Lib\site-packages\tidal_wave\main.py", line 82, in main
    track.get(

  File "C:\Users\ivanp\AppData\Local\pyapp\data\tidal-wave\4771670979927837872\2024.1.12\Lib\site-packages\tidal_wave\track.py", line 568, in get
    if self.download(session, out_dir) is None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\ivanp\AppData\Local\pyapp\data\tidal-wave\4771670979927837872\2024.1.12\Lib\site-packages\tidal_wave\track.py", line 328, in download
    outfile: Optional[Path] = self.download_urls(
                              ^^^^^^^^^^^^^^^^^^^

  File "C:\Users\ivanp\AppData\Local\pyapp\data\tidal-wave\4771670979927837872\2024.1.12\Lib\site-packages\tidal_wave\track.py", line 311, in download_urls
    ).run()
      ^^^^^

  File "C:\Users\ivanp\AppData\Local\pyapp\data\tidal-wave\4771670979927837872\2024.1.12\Lib\site-packages\ffmpeg\_run.py", line 325, in run
    raise Error('ffmpeg', out, err)

ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

After that I was experimenting only with that track. The command used to download the track was:

c:\Data\Software\Audio\tidal-wave>tidal-wave_2024.1.12_py311_pyapp.exe --audio-format HiRes --loglevel debug https://tidal.com/browse/track/253102500 .\

It also fails with the same error whne I use the absolute path, like c:\1 I'm not sure how to capture the stderr, so I don't kow what is FFmpeg complaining about.

ebb-earl-co commented 7 months ago

@eevan78 interesting, let me look into this. It might be something fixed with version 2024.1.13, so as soon as the EXE is uploaded, can you retry with that binary? In the meantime, I don't capture the FFmpeg stderr because the operations that tidal-wave is doing are re-muxing, not encoding or decoding, so they should be trivial. However, I have not tested much on Windows, so I will look into this issue and get back to you.

ebb-earl-co commented 7 months ago

@eevan78 I have figured out the issue (I believe). Using the same 2024.1.12 binary on Windows 10, it turns out that the problem is a Windows problem: Illegal character in file name. So, I will have to put some more effort into sanitizing the track names. A fix will be out soon, which will entail a new version.

ebb-earl-co commented 7 months ago

@eevan78 I have figured out the issue (I believe). Using the same 2024.1.12 binary on Windows 10, it turns out that the problem is a Windows problem: Illegal character in file name. So, I will have to put some more effort into sanitizing the track names. A fix will be out soon, which will entail a new version.

@eevan78 having solved the problem mentioned above, I've run into an issue on track 23 of the album you originally linked to. I'm confident that the file name is too long for Windows; there is a 260-character limitation, so I will have to add some more logic to keep (absolute) file names under that limit. Will be ready in version 2024.1.14.

eevan78 commented 7 months ago

Thanks a lot! It would be nice to have some sort of naming template, but if it's complicated to implement, then better to leave it like this. I tend to name tracks on all albums as Track_nn as I never search tracks using filename. So I'm keeping the filename short. But that's only me... Other people prefer something else.

уто, 30. јан 2024. 02:12 Colin Coe @.***> је написао/ла:

@eevan78 https://github.com/eevan78 I have figured out the issue (I believe). Using the same 2024.1.12 binary on Windows 10, it turns out that the problem is a Windows problem: Illegal character in file name. So, I will have to put some more effort into sanitizing the track names. A fix will be out soon, which will entail a new version.

@eevan78 https://github.com/eevan78 having solved the problem mentioned above, I've run into an issue on track 23 of the album you originally linked to. I'm confident that the file name is too long for Windows; there is a 260-character https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation limitation, so I will have to add some more logic to keep (absolute) file names under that limit. Will be ready in version 2024.1.14.

— Reply to this email directly, view it on GitHub https://github.com/ebb-earl-co/tidal-wave/issues/62#issuecomment-1915666212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGSMGQUZDZL65W4FKTG4BM3YRANEDAVCNFSM6AAAAABCN76MG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJVGY3DMMRRGI . You are receiving this because you were mentioned.Message ID: @.***>

ebb-earl-co commented 7 months ago

@eevan78 a configuration for naming template is an option, but I am loath to introduce the complexity... I started this thinking that users of the project could rename however they like once they've got the files downloaded.

This here issue should be solved in the newest version, 2024.1.15. Please give it a go and report back!

eevan78 commented 7 months ago

@ebb-earl-co I have tried the newest version, and I can confirm that it is working properly on Windows. Thanks for a fix!