rakuri255 / UltraSinger

AI based tool to convert vocals lyrics and pitch from music to autogenerate Ultrastar Deluxe, Midi and notes. It automatic tapping, adding text, pitch vocals and creates karaoke files.
MIT License
232 stars 19 forks source link

Htdemucs errors out on youtube videos with special characters in their names #67

Open stripu opened 1 year ago

stripu commented 1 year ago

Youtube Videos with special characters in their titles error out on track separation with htdemucs, as below:

(.venv) F:\UltraSinger>UltraSinger.py -i https://www.youtube.com/watch?v=FoV8lkAa_rM The torchaudio backend is switched to 'soundfile'. Note that 'sox_io' is not supported on Windows. The torchaudio backend is switched to 'soundfile'. Note that 'sox_io' is not supported on Windows. [UltraSinger] Using cuda GPU. [UltraSinger] full automatic mode [youtube] Extracting URL: https://www.youtube.com/watch?v=FoV8lkAa_rM [youtube] FoV8lkAa_rM: Downloading webpage [youtube] FoV8lkAa_rM: Downloading android player API JSON [UltraSinger] Creating output folder. -> F:\UltraSinger\output\Căsuța noastră [UltraSinger] Downloading Audio [youtube] Extracting URL: https://www.youtube.com/watch?v=FoV8lkAa_rM [youtube] FoV8lkAa_rM: Downloading webpage [youtube] FoV8lkAa_rM: Downloading android player API JSON [info] FoV8lkAa_rM: Downloading 1 format(s): 251 [dashsegments] Total fragments: 1 [download] Destination: F:\UltraSinger\output\Căsuța noastră\Căsuța noastră [download] 100% of 2.42MiB in 00:00:00 at 44.19MiB/s [ExtractAudio] Destination: F:\UltraSinger\output\Căsuța noastră\Căsuța noastră.mp3 Deleting original file F:\UltraSinger\output\Căsuța noastră\Căsuța noastră (pass -k to keep) [UltraSinger] Downloading Video [youtube] Extracting URL: https://www.youtube.com/watch?v=FoV8lkAa_rM [youtube] FoV8lkAa_rM: Downloading webpage [youtube] FoV8lkAa_rM: Downloading android player API JSON [info] FoV8lkAa_rM: Downloading 1 format(s): 137+140 [dashsegments] Total fragments: 2 [download] Destination: F:\UltraSinger\output\Căsuța noastră\Căsuța noastră.f137.mp4 [download] 100% of 10.77MiB in 00:00:00 at 26.65MiB/s [dashsegments] Total fragments: 1 [download] Destination: F:\UltraSinger\output\Căsuța noastră\Căsuța noastră.f140.m4a [download] 100% of 2.36MiB in 00:00:00 at 42.20MiB/s [Merger] Merging formats into "F:\UltraSinger\output\Căsuța noastră\Căsuța noastră.mp4" Deleting original file F:\UltraSinger\output\Căsuța noastră\Căsuța noastră.f137.mp4 (pass -k to keep) Deleting original file F:\UltraSinger\output\Căsuța noastră\Căsuța noastră.f140.m4a (pass -k to keep) [UltraSinger] Downloading thumbnail [youtube] Extracting URL: https://www.youtube.com/watch?v=FoV8lkAa_rM [youtube] FoV8lkAa_rM: Downloading webpage [youtube] FoV8lkAa_rM: Downloading android player API JSON [UltraSinger] Creating output folder. -> F:\UltraSinger\output\Căsuța noastră\cache [UltraSinger] Separating vocals from audio with demucs and cuda as worker. Important: the default model was recently changed to htdemucs the latest Hybrid Transformer Demucs model. In some cases, this model can actually perform worse than previous models. To get back the old default model use -n mdx_extra_q. Selected model is a bag of 1 models. You will see that many progress bars per track. Separated tracks will be stored in F:\UltraSinger\separated\htdemucs File F:\UltraSinger\output\Casu?a noastra\Casu?a noastra.mp3 does not exist. If the path contains spaces, please try again after surrounding the entire path with quotes "". [UltraSinger] Converting audio for AI Traceback (most recent call last): File "F:\UltraSinger\UltraSinger.py", line 785, in main(sys.argv[1:]) File "F:\UltraSinger\UltraSinger.py", line 711, in main run() File "F:\UltraSinger\UltraSinger.py", line 299, in run audio_separation_path = separate_vocal_from_audio( File "F:\UltraSinger\UltraSinger.py", line 427, in separate_vocal_from_audio convert_audio_to_mono_wav(vocals_path, settings.mono_audio_path) File "F:\UltraSinger\src\modules\Audio\convert_audio.py", line 15, in convert_audio_to_mono_wav sound = AudioSegment.from_wav(input_file) File "F:\UltraSinger.venv\lib\site-packages\pydub\audio_segment.py", line 808, in from_wav return cls.from_file(file, 'wav', parameters=parameters) File "F:\UltraSinger.venv\lib\site-packages\pydub\audio_segment.py", line 651, in from_file file, close_file = _fd_or_path_or_tempfile(file, 'rb', tempfile=False) File "F:\UltraSinger.venv\lib\site-packages\pydub\utils.py", line 60, in _fd_or_path_or_tempfile fd = open(fd, mode=mode) FileNotFoundError: [Errno 2] No such file or directory: 'F:\UltraSinger\output\Căsuța noastră\cache\separated\htdemucs\Căsuța noastră\vocals.wav'

rakuri255 commented 1 year ago

This is currently cross fixed by the merge of #68 which handels the namings different. But it could still happens in other songs.

stripu commented 1 year ago

Will check and come back with feedback. Thanks!

stripu commented 1 year ago

Still getting the htdemucs error, but now I've also experienced a different issue - the song title is getting replace by the author, as per the log below:

(.venv) F:\UltraStar>py UltraSinger.py -i https://www.youtube.com/watch?v=S3ELSnWybX8 The torchaudio backend is switched to 'soundfile'. Note that 'sox_io' is not supported on Windows. The torchaudio backend is switched to 'soundfile'. Note that 'sox_io' is not supported on Windows. [UltraSinger] Using cuda GPU. [UltraSinger] full automatic mode [youtube] Extracting URL: https://www.youtube.com/watch?v=S3ELSnWybX8 [youtube] S3ELSnWybX8: Downloading webpage [youtube] S3ELSnWybX8: Downloading android player API JSON [UltraSinger] Searching song in musicbrainz [UltraSinger] Found and using Gică Petrescu by Gică Petrescu [UltraSinger] Release year: 1972 [UltraSinger] Creating output folder. -> F:\UltraStar\output\Gică Petrescu - Gică Petrescu [UltraSinger] Downloading Audio [youtube] Extracting URL: https://www.youtube.com/watch?v=S3ELSnWybX8 [youtube] S3ELSnWybX8: Downloading webpage [youtube] S3ELSnWybX8: Downloading android player API JSON [info] S3ELSnWybX8: Downloading 1 format(s): 251 [dashsegments] Total fragments: 1 [download] Destination: F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu [download] 100% of 3.65MiB in 00:00:00 at 53.68MiB/s [ExtractAudio] Destination: F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu.mp3 Deleting original file F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu (pass -k to keep) [UltraSinger] Downloading Video [youtube] Extracting URL: https://www.youtube.com/watch?v=S3ELSnWybX8 [youtube] S3ELSnWybX8: Downloading webpage [youtube] S3ELSnWybX8: Downloading android player API JSON [info] S3ELSnWybX8: Downloading 1 format(s): 135+140 [dashsegments] Total fragments: 1 [download] Destination: F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu.f135.mp4 [download] 100% of 1.25MiB in 00:00:00 at 18.34MiB/s [dashsegments] Total fragments: 1 [download] Destination: F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu.f140.m4a [download] 100% of 3.57MiB in 00:00:00 at 41.33MiB/s [Merger] Merging formats into "F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu.mp4" Deleting original file F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu.f140.m4a (pass -k to keep) Deleting original file F:\UltraStar\output\Gică Petrescu - Gică Petrescu\Gică Petrescu - Gică Petrescu.f135.mp4 (pass -k to keep) [UltraSinger] Downloading thumbnail [youtube] Extracting URL: https://www.youtube.com/watch?v=S3ELSnWybX8 [youtube] S3ELSnWybX8: Downloading webpage [youtube] S3ELSnWybX8: Downloading android player API JSON [UltraSinger] Creating output folder. -> F:\UltraStar\output\Gică Petrescu - Gică Petrescu\cache [UltraSinger] Separating vocals from audio with demucs and cuda as worker. Important: the default model was recently changed to htdemucs the latest Hybrid Transformer Demucs model. In some cases, this model can actually perform worse than previous models. To get back the old default model use -n mdx_extra_q. Selected model is a bag of 1 models. You will see that many progress bars per track. Separated tracks will be stored in F:\UltraStar\separated\htdemucs File F:\UltraStar\output\Gica Petrescu - Gica Petrescu\Gica Petrescu - Gica Petrescu.mp3 does not exist. If the path contains spaces, please try again after surrounding the entire path with quotes "". [UltraSinger] Converting audio for AI Traceback (most recent call last): File "F:\UltraStar\UltraSinger.py", line 840, in main(sys.argv[1:]) File "F:\UltraStar\UltraSinger.py", line 766, in main run() File "F:\UltraStar\UltraSinger.py", line 303, in run audio_separation_path = separate_vocal_from_audio( File "F:\UltraStar\UltraSinger.py", line 435, in separate_vocal_from_audio convert_audio_to_mono_wav(vocals_path, settings.mono_audio_path) File "F:\UltraStar\src\modules\Audio\convert_audio.py", line 15, in convert_audio_to_mono_wav sound = AudioSegment.from_wav(input_file) File "F:\UltraStar.venv\lib\site-packages\pydub\audio_segment.py", line 808, in from_wav return cls.from_file(file, 'wav', parameters=parameters) File "F:\UltraStar.venv\lib\site-packages\pydub\audio_segment.py", line 651, in from_file file, close_file = _fd_or_path_or_tempfile(file, 'rb', tempfile=False) File "F:\UltraStar.venv\lib\site-packages\pydub\utils.py", line 60, in _fd_or_path_or_tempfile fd = open(fd, mode=mode) FileNotFoundError: [Errno 2] No such file or directory: 'F:\UltraStar\output\Gică Petrescu - Gică Petrescu\cache\separated\htdemucs\Gică Petrescu - Gică Petrescu\vocals.wav'