beets icon indicating copy to clipboard operation
beets copied to clipboard

Comments and/or suggestions for plugin to calculate an albums LAME codec?

Open mikeacameron opened this issue 8 years ago • 6 comments

Problem

I created a plugin that exposes an album template field called albumquality. I used portions of library dnuos and converted the used pieces to Python 3.

Biggest feature of this plugin is that it will return the VBR quality between 0 and 9. If something goes awry, then Unknown will be returned.

I ran it over a few hundred albums in my library and it appears to have tagged everything properly.

beets-albumquality

I was wondering if anyone had any comments and/or suggestions?

Setup

  • OS: Windows 10
  • Python version: Python 3.6
  • beets version: 1.4.3

mikeacameron avatar Jan 17 '17 22:01 mikeacameron

Hi! This looks cool. I also notice that Mutagen itself added a feature to expose the LAME header: https://github.com/quodlibet/mutagen/issues/66

Maybe we should just use that directly instead of dnuos?

sampsyo avatar Jan 17 '17 23:01 sampsyo

I had looked at that, but the authors comments seem to all go towards simply using the bitrate rather than exposing the VBR quality. This is why I opted to jank up dnuos for Python 3. I don't like using the average bitrate of a song because I find that using the target averages from here is often wrong when comparing to tools like foobar2000 or MediaInfo that seem to acurately determine if a song is VBR V0, or V2, etc.

mikeacameron avatar Jan 18 '17 17:01 mikeacameron

How does it determine what quality level the album is? I can't figure out the source code.

RollingStar avatar Jan 22 '17 17:01 RollingStar

mutagen 1.37 is out with https://mutagen.readthedocs.io/en/latest/api/mp3.html#mutagen.mp3.MPEGInfo.encoder_settings

lazka avatar Feb 25 '17 11:02 lazka

I'm not sure how mutagen "guesses" but LAME puts the encoder settings in the header info. I'm curious if it's reading that or if its doing a bitrate check

jamescammarano avatar Apr 25 '21 17:04 jamescammarano

See https://github.com/quodlibet/mutagen/blob/30f373fa6d56e1afa17d48a0c6f3e111267fbd32/mutagen/mp3/_util.py#L179

lazka avatar Apr 25 '21 17:04 lazka