Skip to content
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

Transcoding to 320kbps is useless #440

Open
TheMingus opened this issue Feb 24, 2023 · 4 comments
Open

Transcoding to 320kbps is useless #440

TheMingus opened this issue Feb 24, 2023 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@TheMingus
Copy link

Because the audio is sourced from YouTube the highest bitrate audio available is 256kbps. Transcoding the already compressed 256kbps audio to 320 kbps AAC will only result in loss of information as AAC is a lossy codec and transcoding is generally an at least somewhat lossy process.
I suggest instead downloading the maximum of 256kbps and leaving it be, or if the user specifies a lower bitrate downloading YouTube's copy of the audio at that bitrate (which much of the time does exist). If no such version can be found, download the 256kbps copy and transcode to the lower bitrate.

@asif-ansari
Copy link

asif-ansari commented Feb 27, 2023

What I noticed is that Freyr downloads audio from Youtube Music in opus @160kbps quality.
A temporary solution that I found is to use mp4 container which supports opus and is supported by AtomicParsley for tagging, this way I no longer have to transcode and also don't miss out on the metadata tagging.

@miraclx miraclx added enhancement New feature or request help wanted Extra attention is needed labels Apr 6, 2023
@bpfaust
Copy link

bpfaust commented Aug 26, 2023

@asif-ansari can you share a little on how you implemented your workaround?

the output files i get from freyr have terrible sound quality on some of my output devices, but i confirmed that using yt-dl and directly playing the output is fine, so this transcode step is definitely causing some issues.

@miraclx
Copy link
Owner

miraclx commented Aug 31, 2023

Looks like we really need to prioritize this. I don't have a lot of time on my hands right now, and so I haven't looked that deeply but I'm also curious to know how you made this work. I was under the impression that we might have to migrate off AtomicParsley to something like https://github.com/Serial-ATA/lofty-rs - #334

But if we could, for the meantime, retain the use of AtomicParsley but keep the original audio format YouTube serves us, with no observable drawbacks/compatibility issues, that would work perfectly.

@ebbi2017
Copy link

ebbi2017 commented Jan 9, 2024

Yeah I just wanted to ask if it's possible to manually set a bitrate, because I also saw that "Total Network Usage" almost every time is like 50 % of "Total Output size" and yeah, it downloads at 128 or 160 kbps in most cases (if you open the saved m4a with text editor or MediaInfo, look for the yt link, open that one in a browser, copy the full link and use JDownloader2, you get 128 kbps m4a or 160 kbps opus also).

Using the docker version in Linux to download files, which works fine, despite the files get +50-60 % as big as needed.

So when downloading m4a from youtube, we won't need to re-code in 320 kbps m4a, which makes no sense actually, as the sound quality can't get better than the source, actually it will get a tiny bit worse with each re-coding.
"source=target" or no recode at all would make sense here.

Btw., I found an opus addon and cuepoints for WinAmp, which works.
(in_opus_v0.912.zip and CuePlayer057c.zip).
But mostly I use AIMP, because it can show the waveform and waterfall, so you get an idea of the source quality (high dynamics vs. normalized aka loudness war).
RockBox Firmware for iPod Video is nice, but all media players on your phone can play all codecs nowadays, too.
So I think opus makes sense, unless you have some apps like Traktor or whatever, which can't read opus, but m4a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants