HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: Jim P. on 2013-08-31 19:50:38

Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: Jim P. on 2013-08-31 19:50:38
My music collection is about 95% FLAC (nearly all ripped from my original CD's). But I do have a smattering of MP3's that I have acquired for one reason or another. On the side, I like to have everything also available in MP4 (for portable devices). Converting my FLAC to MP4 is of course no problem. But when I attempt to transcode the MP3 to MP4 I get a warning message saying that this will result in a further degradation of quality. (I could of course just leave the MP3's as-is, but I want to have everything uniform.)

I have two questions:

1) just how bad IS the loss of quality going from MP3 to MP4? Is this a significant concern? My MP4 settings are "Very High", around 300 kbps.

2) am I over-thinking the problem if I transcode MP3 > FLAC (which doesn't increase quality at all, but doesn't decrease it either), and then go from FLAC to MP4? Does that effectively work around whatever issue there is with lossy to lossy transcoding?

Thoughts?
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: saratoga on 2013-08-31 20:21:05
Just copy the mp3 files directly to the portable device. Do not transcoded.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: Jim P. on 2013-08-31 20:30:39
Just copy the mp3 files directly to the portable device. Do not transcoded.



Yeah, that's what I actually have done thus far. But it irks me to have two different formats when I'm so close to uniformity. I'm probably just being OCD.

Still curious about lossy > lossy transcoding, but I probably should be in a different forum for that anyway.....
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: Rollin on 2013-08-31 20:35:24
mp3->flac->mp4 has the same quality as mp3->mp4
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: jensend on 2013-08-31 20:44:53
That isn't over-thinking, it's just misunderstanding. If the only source you have is a lossy file, decoding the lossy format and then losslessly compressing the result only gives you a larger file with the same distortions as your lossy source. Encoding the resulting FLAC as MP4 won't give you a warning, because the encoder will no longer be able to tell there's distortions just from the file format, but the end result will be exactly the same loss of quality as the MP3-MP4 "direct" transcode.

(All you've done is stick an invertible operation and its inverse in the chain, which together are the same as doing nothing, just like adding a number and then subtracting it: decode MP3 to PCM -> losslessly compress PCM to FLAC -> decode FLAC to PCM, bit for bit identical to the PCM from decoding the MP3 -> encode PCM to MP4.)

Having everything "uniform" doesn't really provide any advantage. At least for the forseeable future, any device that supports MP4 will support MP3.

Please read the HA Wiki entry on transcoding (http://wiki.hydrogenaudio.org/index.php?title=Transcoding) carefully before proceeding any further.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: Jim P. on 2013-08-31 21:26:39
Encoding the resulting FLAC as MP4 won't give you a warning, because the encoder will no longer be able to tell there's distortions just from the file format, but the end result will be exactly the same loss of quality as the MP3-MP4 "direct" transcode.


Sigh, I suspected as much.  Thanks for the responses!
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: testyou on 2013-09-01 00:20:30
You can try transcoding them, and then performing ABX tests to determine if the generation loss is a problem for you.

I'm happy to keep a variety of file formats if they are from lossy sources, you do not need arbitrary rules of uniformity.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: nu774 on 2013-09-01 05:25:40
If you want lossy -> lossy transcoding with fb2k, just do it directly.
lossy -> FLAC -> lossy only to shut up fb2k warning is a complete non-sense, and actually is worse than simple direct transcoding.
Since FLAC only supports integer PCM, the latter process inevitably involves with quantization (with or without dither / noise shape).
On the other hand, in case of direct lossy->lossy transcoding  fb2k will use float32 as intermediate PCM format as far as encoder supports it. Unnecessary quantization doesn't take place.
Although difference may not be audible, you are just making it worse by adding chain of task. Do it simple.

Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: db1989 on 2013-09-01 10:27:07
To be clear, encoding lossy to lossy involves an intermediate uncompressed stage, just as encoding lossy to lossless; the losslessly compressed result in the former case will be the same as the intermediate decompression in the former case.

An interesting question that I like to pose in these recurring threads and ones with similar ideas, and which I don’t recall having gotten an answer for, is a thought experiment that reframes the original question: How could an intermediate conversion to lossless protect against transcoding issues? In other words, what attributes of that process would grant it quality-restoring powers? There are none. With a basic understanding of the technology, such questions become impossible.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: andrew_berge on 2013-09-01 17:20:29
lossy -> FLAC -> lossy only to shut up fb2k warning is a complete non-sense, and actually is worse than simple direct transcoding.
Since FLAC only supports integer PCM, the latter process inevitably involves with quantization (with or without dither / noise shape).
On the other hand, in case of direct lossy->lossy transcoding  fb2k will use float32 as intermediate PCM format as far as encoder supports it. Unnecessary quantization doesn't take place.
Although difference may not be audible, you are just making it worse by adding chain of task. Do it simple.


Huh. I never realized that.
The one thing i thought of is that FLAC can't handle samples above 0dB, while this can happen (and quite often, i've found) in mp3, resulting in a loss of quality (possibly audible?) when converting mp3 to FLAC.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: greynol on 2013-09-01 17:35:03
Do it simple.

Which in this case is not to transcode at all.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: phofman on 2013-09-01 18:54:13
The question is what DAC technology can handle samples above 0dbFS.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: greynol on 2013-09-01 19:21:25
The question was whether lossy -> flac -> lossy was better than lossy -> lossy.

As to the off-tooic question about DACs and samples above 0dBFS, the worthwhile answer will only be found in an ABX test.
Title: Using FLAC to avoid problems with lossy -> lossy transcoding?
Post by: nu774 on 2013-09-02 03:34:39
The question is what DAC technology can handle samples above 0dbFS.

You can just turn software volume down if you worry about lossy files with peaks above 0dBFS (or you can simply apply replaygain).
That's completely different from playing files that are already hard clipped.
Try the attached file. AAC is original with peak of +3dBFS or so, and FLAC one is converted from AAC using fb2k (without applying gain or something).