llealloo/audiolink

AudioLinkYtdlpPlayer does not support Audio-only formats

BluWizard10 opened this issue · 1 comments

Describe the bug in detail:
As the Ytdlp Player reads URLs from BOTH video and audio-based sources, it apparently doesn't support sources that are Audio only, such as Soundcloud.

Provide steps/code to reproduce the bug:
Try to load a song from the Soundcloud URL with the AudioLinkYtdlpPlayer in Unity. It will throw an invalid video format error.

Expected behavior:
It should play the audio from Soundcloud without problems.

Additional Information:
Add support for Soundcloud URLs and other sources that are audio-only, just in case YouTube breaks anything with their format (as they just did with Unity Video).

I checked what formats soundcloud provides.

yt-dlp https://soundcloud.com/foobar/spongebob --list-formats --get-url
ID           EXT  RESOLUTION │ PROTO │ VCODEC     ACODEC   ABR
──────────────────────────────────────────────────────────────
hls_opus_64  opus audio only │ m3u8  │ audio only unknown  64k
hls_mp3_128  mp3  audio only │ m3u8  │ audio only unknown 128k
http_mp3_128 mp3  audio only │ http  │ audio only unknown 128k

So only mp3 and opus. Unity's video player (which the ytdlp integration uses) does not support either of these formats https://docs.unity3d.com/Manual/VideoSources-FileCompatibility.html In fact, I don't believe any container formats that support audio-only files are supported.

The only way I could see to implement this is having a format conversion step that takes the audio file and converts it to a supported video format, for example using ffmpeg. I think this is out of scope for AudioLink.