getmusicbee.com

General => MusicBee Wishlist => Topic started by: johnmillsjr on November 18, 2019, 08:33:47 PM

Title: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 18, 2019, 08:33:47 PM
I've been thinking about this for quite a while, and I've wondered why file converters don't do this.

I convert all my lossless files to mp3 at the highest bitrate.

On occasion, I come across flac files that are less than 320.

When this happens, I have to go through the process multiple times, first doing the 320+ at 320CBR and then converting anything lower at the highest matching VBR setting.

Could a setting be added to auto select the best setting automatically?
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 19, 2019, 04:34:05 PM
On occasion, I come across flac files that are >320.
When this happens, I have to go through the process multiple times, first doing the 320+ at 320CBR and then converting anything lower at the highest matching VBR setting.

I don't understand what your thought- and work process is.
Flac is lossless, and except for some mono recordings, the bitrate will be much higher than 320kbps, and more importantly, it is by no means any indication of sound quality. (contrary to any lossy format)

You can convert a flac file to an mp3 file with the encoding quality of your choice in one step.
I don't understand what makes you perform any additional steps.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: psychoadept on November 19, 2019, 05:57:53 PM
Aren't all FLAC files > 320? If not, I would suspect a problem with the source.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 19, 2019, 06:03:32 PM
Aren't all FLAC files > 320? If not, I would suspect a problem with the source.

Not sure, in my library I found a flac mono track that by MusicBee is reported to be exactly 320kbps.
dBpoweramp will report it as 1.411kbps though. (the original lossless bit rate)
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 19, 2019, 06:58:01 PM
On occasion, I come across flac files that are >320.
When this happens, I have to go through the process multiple times, first doing the 320+ at 320CBR and then converting anything lower at the highest matching VBR setting.

I don't understand what your thought- and work process is.
Flac is lossless, and except for some mono recordings, the bitrate will be much higher than 320kbps, and more importantly, it is by no means any indication of sound quality. (contrary to any lossy format)

You can convert a flac file to an mp3 file with the encoding quality of your choice in one step.
I don't understand what makes you perform any additional steps.


Aren't all FLAC files > 320? If not, I would suspect a problem with the source.

Not sure, in my library I found a flac mono track that by MusicBee is reported to be exactly 320kbps.
dBpoweramp will report it as 1.411kbps though. (the original lossless bit rate)





Because I want to get the highest quality mp3 file I can from the lossless files. You never convert to a bitrate higher than the source. an auto select setting would mean you wouldn't have to change settings for loseless files is 320<
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 19, 2019, 07:24:39 PM
flac is lossless by definition.
The bit rate indication you refer to has nothing to do with sound quality. It's only some indication of the data compression and the burden on processing and transfer speed.
It's about data compression, not about audio compression.

MP3 is lossy by definition.
Whatever mp3 setting you use for encoding flac to mp3, you will always lose audio information.

So, doing it once will always reduce the sound quality, and doing it twice will reduce the sound quality twice.

Another way to explain it in case you work with image files sometimes:
It's similar to converting a png or a bmp to a jpg.
There is no setting for encoding to jpg that is so high that no information from the original picture is altered or degraded. It will always be of an objective lower quality.

(o.k. a 1 pixel image with a web table colour would probably be an exception)
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: smann on November 19, 2019, 09:19:57 PM
Aren't all FLAC files > 320? If not, I would suspect a problem with the source.

Technically it all depends on what is contained within a track, since the bitrate is just an average overall for the whole song. I have a couple of short songs that have huuuugggeeee silent gaps after them with a short hidden track or instrumental at the end of an album. Overall they come out to less than 320kbps when in FLAC. Then there are a couple of silent tracks or tracks that are simply muffled recordings of speeches or so for "theatrical" effect for the album. But yeah, all normal songs are well above 320kbps for FLAC.


To answer the initial question...

I think the OP meant to say <320kbps FLAC files in the original post, not >320kbps, which is where the confusion is coming from.

I would just convert straight to 320kbps CBR MP3 for all the files as this will be extremely rare. Technically you're throwing information out for all of the other tracks when converting anyways, it would still throw out information and be around the same overall quality as the rest of the tracks. The whole reason you don't upconvert is because you're making the size larger without gaining anything, and upconverting to another lossy format would just throw out more information and actually reduce quality while being a larger size. For a couple of songs, this won't really cause any issues or hinder their quality noticeably when going from <320kbps FLAC to 320kbps CBR MP3.

Plus one single track on an album being VBR while everything else is CBR would annoy the heck out of me haha.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 19, 2019, 09:42:10 PM
Technically it all depends on what is contained within a track, since the bitrate is just an average overall for the whole song.

All interesting for sure, but the main issue here is that the OP seems to assume that when a flac file is reported to be 300kbps, it would be overkill to encode it to 320kbps mp3.
It isn't, since the flac is lossless, and converting it to mp3 will by design degrade it. Always.
This isn't about actual technical bit rates, it is about a misconception that bit rates of lossless and lossy codecs are to be considered equal and comparable. They are not.

On a side note, not relevant to the actual q and a here, I am curious about the <320kbps flac files the OP seems to have in his library.
Are they mono recordings, audiobooks, what?
Or as psychoadept suggested, possibly defective files?
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 19, 2019, 10:45:01 PM
Yes I put my side ways triangles wrong. I want flac files less than 320 to go to the closest vbr setting of the source bitrate

they were rare occasions of 1920s recordings.

I convert my music to mp3 so i can use id3tags and keep a flac archive.

I'm well aware that mp3s are all degraded, I just like to choose the best quality settings I can reach without exceeding the source- and not making the file any bigger than my already over kill 320 life-choices already does so.

Just let me convert my mp3s  :'(  :'(  :'(  :-*  :-*  :-*  :-X  :P  8)
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: phred on November 19, 2019, 10:45:37 PM
The only thing I'll add here to the OP is that one should never (never, NEVER) re-encode an mp3 file. Neither up nor down. You'll be taking a lossy file and making it even more lossy.

I've heard of people who download the audio from a YouTube video and then re-encode it to 320 thinking it's going to improve the quality. Nope. Doesn't happen.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 19, 2019, 10:47:29 PM
I'm not re-encoding mp3s!!

I'm talking about converting lossless to mp3
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: phred on November 19, 2019, 10:53:53 PM
I understand that. I just felt it was worth pointing out for anyone not aware of the pitfalls of re-encoding mp3s.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 19, 2019, 11:00:42 PM
I'm not re-encoding mp3s!!

You originally mentioned converting lossless to lossy in two steps. The second step would be re-encoding wouldn't it?
If you want to encode flac to mp3, forget about what bit-rate is reported for the flac file, it is completely irrelevant here.
Just choose an mp3 encoding quality that you are happy with and convert the flac to that.
No matter what bit-rate you saw reported for the flac, the sound quality will always degrade when converting to mp3.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 19, 2019, 11:08:03 PM
no,

I said

1. convert flac files of 320+ to 320cbr mp3
2. convert flacs that are less than 320 to the nearest matching bitrate possible mp3

And have mb choose the settings automatically.

I know it degrades no matter what, but i just want to get the best qaulity mp3 I can get under it's parameters.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 19, 2019, 11:08:50 PM
I understand that. I just felt it was worth pointing out for anyone not aware of the pitfalls of re-encoding mp3s.

Ah ok :)
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 19, 2019, 11:16:01 PM
2. convert flacs that are less than 320 to the nearest matching bitrate possible mp3

Ah, ok. I thought you meant using two sequential steps, but you meant two different possible steps.
So is it now cleared up that however low the reported flac bit-rate is, the 'nearest matching' mp3 bit rate will always be the highest possible available mp3 bit-rate?
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 19, 2019, 11:45:42 PM
yeah, probably the highest vbr profile nearest the source bitrate
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 20, 2019, 12:24:03 AM
yeah, probably the highest vbr profile nearest the source bitrate

Nope.
The highest possible mp3 profile will be closest to the flac.
Even the highest possible lossy profile will always be less than the lossless source.

I'll retreat now, it seems I am inadequate in explaining this good enough.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: psychoadept on November 20, 2019, 12:35:02 AM
Personally, I'd take advantage of the ability to choose a profile based on source format, although I suppose bitrate would work, too.

FLAC I always convert to 320 CBR. M4A I convert to VBR 0, but I think they're always 256 VBR to start out with (from iTunes). I know M4A to MP3 is lossy to lossy, but tagging support for M4A is so crap that it's worth it to me.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 20, 2019, 12:57:50 AM
Personally, I'd take advantage of the ability to choose a profile based on source format, although I suppose bitrate would work, too.

FLAC I always convert to 320 CBR. M4A I convert to VBR 0, but I think they're always 256 VBR to start out with (from iTunes). I know M4A to MP3 is lossy to lossy, but tagging support for M4A is so crap that it's worth it to me.

Since we are freewheeling now:
I struggled a while about what to do with formats other than flac or mp3. (which are my two preferred formats by far)
If it was only for tagging purposes I don't like to have formats such as m4a, wma etc. in my library.
That gave me two options:

1. Preserve the sound quality and encode them to flac. But then I would have flac files that would give the impression they were of lossless quality witch would be false. So that was a no.

2. Re-encode them to mp3. But that would result in an additional loss in quality. Not something to lose too much sleep about, but still not very desirable. (and I might loose my audiophile badge ;-)

Then a light bulb appeared above my head.
Any lossy format other than mp3 gets converted to ape.
Ape will contain the original audio without additional loss, and it presents no problems related to tagging.

So now my library contains only three formats that each present a clear purpose to me:

Lossless: flac
Lossy: mp3
Lossy that was converted from some other format: ape

Easy to remember, and no tagging challenges anymore.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 20, 2019, 01:01:15 AM
Personally, I'd take advantage of the ability to choose a profile based on source format, although I suppose bitrate would work, too.

FLAC I always convert to 320 CBR. M4A I convert to VBR 0, but I think they're always 256 VBR to start out with (from iTunes). I know M4A to MP3 is lossy to lossy, but tagging support for M4A is so crap that it's worth it to me.

Since we are freewheeling now:
I struggled a while about what to do with formats other than flac or mp3. (which are my two preferred formats by far)
If it was only for tagging purposes I don't like to have formats such as m4a, wma etc. in my library.
That gave me two options:

1. Preserve the sound quality and encode them to flac. But then I would have flac files that would give the impression they were of lossless quality witch would be false. So that was a no.

2. Re-encode them to mp3. But that would result in an additional loss in quality. Not something to lose too much sleep about, but still not very desirable. (and I might loose my audiophile badge ;-)

Then a light bulb appeared above my head.
Any lossy format other than mp3 gets converted to ape.
Ape will contain the original audio without additional loss, and it presents no problems related to tagging.

So now my library contains only three formats that each present a clear purpose to me:

Lossless: flac
Lossy: mp3
Lossy that was converted from some other format: ape

Easy to remember, and no tagging challenges anymore.

In my case, I have a crazy/sohpisticated cataloging system for my music via id3tags- hence my mp3 conversions (coverting flac to mp3)
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 20, 2019, 01:03:28 AM
yeah, probably the highest vbr profile nearest the source bitrate

Nope.
The highest possible mp3 profile will be closest to the flac.
Even the highest possible lossy profile will always be less than the lossless source.

I'll retreat now, it seems I am inadequate in explaining this good enough.

I meant for the rare occasions when the flac is lower than 320- which is rare- but it happens
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 20, 2019, 01:03:46 AM
In my case, I have a crazy/sohpisticated cataloging system for my music via id3tags- hence my mp3 conversions (coverting flac to mp3)

Do you mean that flac files pose problems in your tagging system?
Can you tell what problems exactly?
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 20, 2019, 01:05:24 AM
I'll retreat now, it seems I am inadequate in explaining this good enough.

I meant for the rare occasions when the flac is lower than 320- which is rare- but it happens

I'll retreat now, it seems I am inadequate in explaining this good enough. ;-)
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 20, 2019, 02:06:18 AM
I'm sorry if i'm missing something

All i'm trying to say is: if a lossless source file is 1000kbps I covert the file to mp3 CBR 320

If it's 255 (which is rare for a lossless file- but it' happens) I make it vbr 220-260

Lower than, I match it with the next mating vbr setting and so on.


All I'm suggesting is a function that selects the conversion settings based on that for each file- so you dont have to set up multiple conversion 'sessions' of doing the 320+ to 320cbr first, then the next set of files and so on.

Or I'm completely wrong about the optimum way to convert to mp3- and I'm missing something you're saying to that effect- if so I'm sorry
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: hiccup on November 20, 2019, 02:27:29 AM
I'm sorry if i'm missing something

Never apologize for not understanding something. It's a sign that you want to learn.

Maybe somebody else can explain the technicalities about bit rates and how they relate between lossy and lossless audio in an understandable manner.

The best way that I can explain it:
As soon as you use an mp3 encoder to convert from lossless to lossy, the codec will change the original audio data. Always.
It will use a very smart algorithm to 'listen' to the audio data, it will try to maintain what human ears are sensitive to, and throw away as much as possible data that human ears (and brains) are less sensitive to.
It will not look at the reported bit rate of the source file and then say, ah well, that's o.k., let's leave that just as it is.
It will always write a new and altered audio file.
And that will always result in some sort of degradation.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: frankz on November 20, 2019, 02:54:54 AM
The bit rate of a flac file is irrelevant. It's like dividing the file size of a Word document by its character count and calling it the bit rate of your Word document.

Conversion to flac rearranges the data, like a zip file would to a text document. Conversion to lossy alters the audio. Comparing between the two is a non sequitur. Using the measure of one process to decide how to handle the other is faulty logic.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 20, 2019, 03:15:32 AM
I'm sorry if i'm missing something

Never apologize for not understanding something. It's a sign that you want to learn.

Maybe somebody else can explain the technicalities about bit rates and how they relate between lossy and lossless audio in an understandable manner.

The best way that I can explain it:
As soon as you use an mp3 encoder to convert from lossless to lossy, the codec will change the original audio data. Always.
It will use a very smart algorithm to 'listen' to the audio data, it will try to maintain what human ears are sensitive to, and throw away as much as possible data that human ears (and brains) are less sensitive to.
It will not look at the reported bit rate of the source file and then say, ah well, that's o.k., let's leave that just as it is.
It will always write a new and altered audio file.
And that will always result in some sort of degradation.

I understand that, but at the end of the day, something has to choose the bitrate setttings, to covert to a mp3 based on what you select in the converter? The highest bit rate gives the converter more bandwidth to work with doesn't it?

could you elaborate more? because all I'm able to draw from that is that it doesnt matter what bitrate you choose- and I don't think that's quite true
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: sveakul on November 20, 2019, 03:45:16 AM
What hiccup is saying is that any conversion from a lossless FLAC to a lossy mp3 (or any other lossy format) involves audio degradation.  That said, by adjusting the bitrate of the mp3 converter, in this case Lame.exe, you can reduce the AMOUNT of the degradation, at least in an audible sense.  So the bitrate set for the conversion process DOES matter.

You can set the MusicBee encoding presets to any custom value you choose in Prefs/File Converters.  Currently the max preset for mp3 in my setup uses the parameters "--vbr-new -V 0 --noreplaygain - [outputfile]" .  You can change that to a constant 320k bitrate if you like (see https://wiki.hydrogenaud.io/index.php?title=LAME#Understanding_the_bitrate_settings (https://wiki.hydrogenaud.io/index.php?title=LAME#Understanding_the_bitrate_settings) for starters).  However, I find the V0 setting produces audibly identical results to CBR 320 at a significant size savings.

BTW, the "--vbr-new" part is no longer needed in new Lame versions as it is now the default when the "V" switch is used.   Doesn't hurt to leave it in though.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: Zak on November 21, 2019, 03:09:13 AM
Converting a <320 kbps FLAC file to CBR 320 kbps MP3 will make a larger file that (theoretically) sounds worse. So unless it's for compatibility reasons, I'm not sure you'd want to convert them anyway.

I'll also throw in that you shouldn't get too hung about the numbers.
I know a lot of us here have varying degrees of obsessiveness about consistent tags etc. but you can waste days of your life worrying about this stuff and it's not worth it.
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: johnmillsjr on November 21, 2019, 03:26:46 AM
Converting a <320 kbps FLAC file to CBR 320 kbps MP3 will make a larger file that (theoretically) sounds worse. So unless it's for compatibility reasons, I'm not sure you'd want to convert them anyway.

Could you elaborate on why?
Title: Re: Auto selecting file coversion settings based on Source Bitrate
Post by: Zak on November 21, 2019, 07:33:23 AM
If the bitrate of each FLAC file is consistently less than 320 kbps for the entire audio stream, the overall file size will be smaller than a file with a CBR of 320 kbps.
The file size is just the bitrate multiplied by the duration in seconds*.

Whether it's lossless or lossy doesn't matter - the only reason a typical FLAC file is much larger isn't because it's lossless, it's because it requires a much higher bitrate in order to be lossless.

*To be clear, I should have said may make a larger file - because FLAC uses a variable bit rate you can't really do a direct comparison to a CBR MP3 (or CBR aac, opus or anything else). It would depend on the file.

However, it sounds like you have some outliers that are either:
a) very receptive to FLAC compression, or
b) reporting their bitrate incorrectly.

You could easily test this though by converting one to mp3 and comparing the sizes.

I'm also curious because all of my FLAC files show bitrates closer to 1000 kbps, which is more typical.
Can you post some example file sizes and durations of the ones that are reporting their bitrate as less than 320?