Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Can re-encoding into a different audio codec significantly worsen audio? (Read 2023 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Can re-encoding into a different audio codec significantly worsen audio?

I'm curious whether anyone has ever tried to test whether re-encoding from one audio codec to another audio codec introduces new compression artifacts or exacerbates  audio compression artifacts for the first audio codec.

This is actually what people nowadays are dealing with daily:

YouYube/YouTube Music -> Opus -> BlueTooth SBC/Apt/AAC/etc.
Spotify -> Vorbis -> BlueTooth
Apple iTunes -> AAC -> BlueTooth


Re: Can re-encoding into a different audio codec significantly worsen audio?

Reply #1
From the headline I assumed significantly more than re-encoding to the same, and that would suggest a test that fixes quality level across codecs by selecting parameters that generally give the same level of "perceptive/annoying", and see if that changes when the source is a different lossy codec than the target.

But as your suggested application fixes target codec, the question would then rather be sources of different codecs but "equal quality"?

That would be then:
* look up previous listening tests and find that codec1setting1, codec2setting2 etc came out equally "perceptive but not annoying"
* encode lossless original in each of those settings
* and then assess say BT (SBC) listening quality?
I don't know any such tests, but I wouldn't be surprised if a HA link gets posted - and I wouldn't be surprised if it would be @Kamedo2  ;)

Re: Can re-encoding into a different audio codec significantly worsen audio?

Reply #2
This is actually what people nowadays are dealing with daily:

Yes, YouTube/YouTube music(Opus) to Bluetooth(AAC) is one of the most frequent re-encoding situation.
Short answer: not that bad.
Opus 128kbps to AAC-LC 160kbps software re-encoding resulted in MOS 4.35 and 4.36 for Apple, Android.
Very close to what you would expect for Opus 128kbps, with no further re-encoding.
https://hydrogenaud.io/index.php/topic,122575.0.html

Re: Can re-encoding into a different audio codec significantly worsen audio?

Reply #3
I thought Youtube  Music was AAC.

Anyway, if it were truly awful, I'd expect there to have been people massively complaining outside of audiophool circles (the same ones that think AptX is lossless)

Re: Can re-encoding into a different audio codec significantly worsen audio?

Reply #4
It should mostly only matter when bitrate is low or you're doing more than a few transcodes. It would be interesting to see how many transcodes it takes for something like opus 128-192 to deteriorate to the point of noticeability and to the point of trashing it. Might need to hop between different codecs as constantly transcoding with the same codec may be misleading (it might acquire and store metrics at the same points every time meaning it deteriorates less than you'd expect).

Re: Can re-encoding into a different audio codec significantly worsen audio?

Reply #5
It should mostly only matter when bitrate is low or you're doing more than a few transcodes. It would be interesting to see how many transcodes it takes for something like opus 128-192 to deteriorate to the point of noticeability and to the point of trashing it.

There have been a few "re-encode N times" (like, N=100) tests, and AAC comes out good - but I wonder if it was an Opus encoder that would make issues with initial (/final?) samples and thus track transitions would get bad quite quickly. Did a quick search and didn't find it, could be that my memory is completely off.

Re: Can re-encoding into a different audio codec significantly worsen audio?

Reply #6
Quote
could be that my memory is completely off
No but unfortunately the original post at HA and the website have lost their pic's
Try this one: https://www.thewelltemperedcomputer.com/KB/Generation.htm
TheWellTemperedComputer.com

 

Re: Can re-encoding into a different audio codec significantly worsen audio?

Reply #7
Ah, and a couple of clicks away, here is what happened yes:

Quote
Hi again,
It turns out that the "problem" wasn't even the resampling itself but that the way we were doing it was causing a delay by a fractional number of samples, causing the frame alignment to slightly drift for each encoding pass. Just removing that fractional delay made Opus behave at least as good (possibly better) than AAC, even when resampling every time. That being said, the interesting test (and the common was people test) would be to do "asynchronous cascading" for all the codecs. i.e. after each encode+decode cycle, introduce a random delay in the audio. It's well known that if you have a fixed frame size (which is the case of Opus and AAC, but not Vorbis), then you get much better cascading quality if the frames always align than if the alignment is different every time.

Jean-Marc (author of Opus)