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: Transcoding between lossless formats, bitrates, and preserving lossy content (Read 4676 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Transcoding between lossless formats, bitrates, and preserving lossy content

Hi all,

If I have a lossy file and (in lieu of getting a better/lossless copy), would like the file in a different format - what advice can you give regards the conversion?

A few examples of the kind of thing i'd like to know - would going up a bitrate retain all of the audio (i.e. 192k AAC > 256k MP3)? Does Stereo vs Joint Stereo in the compressed source or output file matter? Would it be best to convert to a lossless format to retain all of the already-lossy audio?

Ignore the 'why' - let's assume an incompatibility between a player and an audio file perhaps.

I'm just interested in the differences between popular lossy formats and what happens if you go from one to the other. Will you further lose fidelity, and if so how much? 1%, 10% etc. And also, if you flip back and forth between two lossy formats, will you ultimately end up with a stable/unchanging file or will every conversion yield more and more and more loss? Specific to MP3 - would a 10-15yr old MP3 at 320k be worse/same/better than a modern MP3 rip at 192k for example?

I posted this on Reddit to r/audiophile and was advised to check here. I've searched the forums here but not exactly found a post to answer the above.


Re: Transcoding between lossless formats, bitrates, and preserving lossy content

Reply #2
Do not convert one lossy to another lossy file. It will always be worse quality than the original!
When you convert one lossy format to another, then you will have both imperfection of both formats. If you do it only one time and use high quality settings, then you probably won't hear any difference.
Even if you reencode a lossy file to the same format (even with with exact same setting) you will get a generation loss.

If you do not have a choice and need to convert, then i would advice to keep the original lossy files.
If you keep the original it doesn't really matter what you convert them into. You can always go back to the original files and convert those again in another/better way :).

Lossy codecs work best when using variable bitrate. Convert to lame -V2. Which gives a similar bitrate and quality as aac 192kbps. You can try other bitrates from -V5 to -V0. You will find that -V5 (around 128kbps) sounds very good already. -V0 is the highest variable bitrate at around 256kbps.

Some players do not support variable bitrate well, so then you don't have a choice. And you will need to go for constant bitrate. I would go for something sane like 192kbps.
I would never advice to use 320kbps. It's simply the least efficient setting :) (a waste of space).

I'd say most 10-15 year old mp3 can sound very very good. But it all depends on the encoder and settings which were used.
Most really bad mp3 encoders were used before 2005 though. In that period most people just used whatever was fastest (because CPUs were slow) and people were not aware of audio quality differences. Also bad (fastest) CD extraction programs were used, which caused pops/scratches before the audio was even encoded into mp3.
Nowadays bad encoders are only rarely used. Stupid settings are still used, like constant bitrate and stereo mode. However the used bitrates are so high that bad settings are rarely noticeable anyhow.


Joint stereo (*sigh*). I kept the best for last ;). Just use the default, which will be joint stereo. Joint stereo is more efficient, thus better. Simple example: if you have a mono song, then both L and R are exactly the same. It will be a waste of space to encode both identical channels twice. So in this case joint stereo will switch to Mid-side stereo. One channel contains the mid and the side channel contains the difference which in a mono song will be zero. That way for a mono song all bits can go to the mid channel.
However when both channels are very different, joint stereo will dynamically switch to normal stereo mode.
So for each very short piece of audio in a song, it will determine what will be best mid/side or normal stereo, and switch to that mode, to be most efficient. And efficient means better quality for the same bitrate!

Re: Transcoding between lossless formats, bitrates, and preserving lossy content

Reply #3
Would it be best to convert to a lossless format to retain all of the already-lossy audio?
To fully keep quality you can only use lossless. But you may get the same perceptual quality by using any lossy format but it depends of many factors.

Will you further lose fidelity, and if so how much? 1%, 10% etc
You can't precisely quantify in a reliable way the loss. From lossy to lossy you get something different, and not necessary inferior perceptualy. You can even get better subjective quality with reencoding (i.e. if the second lossy encoding removes ringing).

And also, if you flip back and forth between two lossy formats, will you ultimately end up with a stable/unchanging file or will every conversion yield more and more and more loss?
Each new iteration changes the signal. Depending on the encoder/format and the listener, this change may be audible or not.

Specific to MP3 - would a 10-15yr old MP3 at 320k be worse/same/better than a modern MP3 rip at 192k for example?
10…15 years old doesn't mean that much. There were few progress (if any) with MP3 during the last ten years and some 10…15 years encoders are simply excellent.
You might keep the same subjective quality if you compare a very old ISO or close to ISO MP3 encoder at 320 kbps (like BLADE MP3) with a modern VBR encoding at ~192 kbps. Again, it depends of the listener.
BTW if your old MP3@320 are coming from unknown source it may be a good idea to consider a switch: many files shared on internet were transcoded from inferior bitrate source.

Also keep in mind that the opposite way of thinking also work: a bad MP3 encoder can be used to efficiently reduce the size of a 320 kbps LAME 3.100 without subjective loss. Again it depends very much of the listener.


In short: try yourself. Depending on your subjectivity, your skills, your music, your sources, and your output format and its settings you might get really good results while re-encoding to a different format at inferior bitrate. But there is no universal answer and what works for someone could sound unacceptable to the other.


Re: Transcoding between lossless formats, bitrates, and preserving lossy content

Reply #5
Do not convert one lossy to another lossy file. It will always be worse quality than the original!
When you convert one lossy format to another, then you ......

Many thanks for your comprehensive reply - That was really helpful! A quick question about VBR - I've got albums of files in that format, but never encoded in VBR myself. When I see an album with bitrates generally around the 256k mark, but some going up to say 270k or down to 189k etc - does it mean that each track is variably encoded based on a specific 'global' bitrate or per-track? In other words, do you set the VBR to a value, say '256k'  or just fire it of and let it choose? And since CBR seems to be 128,192,256,320 etc, what do bitrates of say 272k mean in terms of how they were selected for encoding?

Re: Transcoding between lossless formats, bitrates, and preserving lossy content

Reply #6
To fully keep quality you can only use lossless. But you may get the same perceptual quality by using any lossy format but it depends of many factors.

You can't precisely quantify in a reliable way the loss. From lossy to lossy you get something different, and not necessary inferior perceptualy ......

Thank you for the detailed reply. I hadn't thought of the 'perceptually better' explanation going from lossy to lossy - I'm guessing also 'loudness' can be affected too? I've certainly had some files that after conversion to a lesser format (usually from lossless to AAC/MP3) seemed to sound somehow better - I presumed it was probably just a placebo around the volume level since any lossy compression would surely reduce quality, but as you say with 'perceptually better' perhaps some 'harsh' recordings in FLAC have benefitted from lossy compression perceptually?

Re: Transcoding between lossless formats, bitrates, and preserving lossy content

Reply #7
I wouln't count too much on sound improvement. It's rare. Sometimes very bad encoding could sound better to some listeners after being recoded a second time: it's not the encoding itself that improve sound but rather the lowpass which erases high frequency ringing. Lowpass isn't a good thing but in rare cases it may be preferable than a big mess in hugh frequencies.
Sometime low bitrate encoders use tools that might emphasis some frequencies: HE-AAC with SBR, Ogg Vorbis at ~64kbps… I heard people prefering the encoded to the original!
But as you're more interested in transparent quality/high bitrate, forget this. It won't happen.
Volume is sometimes lowered (by -0.1 or -0.2 dB) with lossy encoders in order to avoid clipping. It's not really significant.

Re: Transcoding between lossless formats, bitrates, and preserving lossy content

Reply #8
But as you're more interested in transparent quality/high bitrate, forget this. It won't happen.
Volume is sometimes lowered (by -0.1 or -0.2 dB) with lossy encoders in order to avoid clipping. It's not really significant.

Thanks - that's a helpful insight :)

Re: Transcoding between lossless formats, bitrates, and preserving lossy content

Reply #9
Quote
Would it be best to convert to a lossless format to retain all of the already-lossy audio?
The "damage" happens during compression, not during decompression.   When you play a file it gets decompressed so the quality of a WAV or FLAC made from an MP3 is the same as directly-playing the MP3.*

Quote
When I see an album with bitrates generally around the 256k mark, but some going up to say 270k or down to 189k etc -
With VBR the bitrate changes moment-to-moment (frame by frame, I think) depending on the quality setting.  Easy-to-compress sounds get a lower bitrate and harder-to-compress sounds get a higher bitrate.   If I remember correctly, silence at V0 comes out at around 30kbps.

If you choose ABR instead of VBR your are forcing an overall-average bitrate but the bits are allocated moment-to-moment depending on the complexity of the sound.   That's useful if you're trying to hit a specific file size.



*There is a possible exception - MP3s can (and often do) go slightly over 0dB.    Since regular (integer) WAV and FLAC files are hard-limited to 0dB you can get clipping when converting to a lossless format.     If you play the MP3 at full-digital volume it will clip your DAC too, but if the volume is reduced digitally (like with the Windows volume control) you can avoid clipping.    (I've never heard of a case where that slight clipping was audible...   I actually don't know of any such listening tests but if you hear compression artifacts you are probably hearing something else.)

...The lossy compression alters the wave shape making some peaks higher and some peaks lower.   So, if you have a CD with  0dB normalized peaks, it's not unusual for the ripped MP3s to go slightly-over 0dB.,