Skip to content

Downloads track as opus instead m4a #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
ZenKyma opened this issue Sep 2, 2023 · 7 comments · Fixed by #757
Closed
1 task done

Downloads track as opus instead m4a #691

ZenKyma opened this issue Sep 2, 2023 · 7 comments · Fixed by #757
Labels
enhancement New feature or request

Comments

@ZenKyma
Copy link

ZenKyma commented Sep 2, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Pain

Currently tracks are being downloaded as m4a, while opus is youtube's standard audio format.
Comparing to m4a, opus is much more advanced and offers better quality at lower bitrate when compared to m4a, ogg vorbis and mp3. See this comparison:

image

Spotube downloads audio as m4a at around 128kbit but youtube offers opus files up until 152kbit. Here an overview in jdownloader:

image

Suggested solution

It would be awesome if spotube would download opus files at max kbit.
I recommend this as a standard setting instead of m4a. Opus offers better quality audio files with a much lower filesize than mp3 and is increasingly becoming the new standard for lossy audio.

Useful resources

No response

Additional information

Awesome project! Just got the linux flatpak version and enjoying it a lot.

@ZenKyma ZenKyma added the enhancement New feature or request label Sep 2, 2023
@KRTirtho
Copy link
Owner

KRTirtho commented Sep 2, 2023

The opus is actually .webm stream so it'll require ffmpeg to convert that to opus

@KRTirtho
Copy link
Owner

KRTirtho commented Sep 2, 2023

~66MB binary size increase on multiple platforms (except linux) 😅

@ZenKyma
Copy link
Author

ZenKyma commented Sep 3, 2023

The WebM container likely contains the opus file as is, which should be extractable without ffmpeg. See this post:

https://stackoverflow.com/questions/65511370/webm-vs-opus-quality-youtube-dl-context

I couldn't find out yet if spotube is using youtube-dl or a fork of it to get the downloads, in which case one could extract the opus file easily like so:
youtube-dl -f bestaudio --extract-audio --add-metadata [yt-link]

@ZenKyma
Copy link
Author

ZenKyma commented Sep 3, 2023

Can be apparently also extracted with mkvextract from mkvtoolnix library.

See this post:
https://stackoverflow.com/questions/57779975/how-to-extract-audio-from-webm-file

@KRTirtho
Copy link
Owner

KRTirtho commented Sep 3, 2023

Spotube uses YouTubeExplode & a custom download manager. The best I can do is offer download formats (mp4/webm) in the settings & add the ability to download webm. But the user might need to manually change the format

@ZenKyma
Copy link
Author

ZenKyma commented Sep 3, 2023 via email

@hackerb9
Copy link

That would be awesome! I'd appreciate the option 🙏

I second the thanks. Being able to avoid non-proprietary formats will be a nice feature to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Deployed
Development

Successfully merging a pull request may close this issue.

3 participants