leosongwei / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

Lame VBR Preset #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've gone through all python libraries, and even other programs and 
libraries, but I can't find anything that can figure out the VBR preset 
used by LAME on an mp3.

The only program I know of that does it is Mr. QuestionMan
http://www.burrrn.net/?page_id=5
And it works very well, but I want to make renaming scripts and stuff that 
would need to parse mp3s and find that information. Sadly, I can't find any 
way of doing this.

It would be really great if you guys could implement it. Not sure why no 
one has made anything similar. If they can do it, I'm guessing it's 
possible? Unless they guess it according to the average bitrate, but I 
personally doubt that.

And I'm speaking about v0-v9 setting, of course.

Original issue reported on code.google.com by Ph0X...@gmail.com on 3 Jun 2010 at 9:04

GoogleCodeExporter commented 9 years ago
I have an edited version of 1.16 that does just that. Here is the file thats 
changed:

http://pastebin.com/iLTgciTW

I'd love to see this get added to mutagen, so I don't have to keep using this 
hacked up version...

Original comment by nbvF...@gmail.com on 30 Jul 2010 at 8:07

GoogleCodeExporter commented 9 years ago
If you submit a patch, we can look at it.

Original comment by joe.wreschnig@gmail.com on 31 Jul 2010 at 8:55

GoogleCodeExporter commented 9 years ago
Its actually a modified off of the 1.12 release of mutagen, and I can't find 
that version anywhere, so I can't make a diff. I didn't do the modifications, 
so I can't work out what was all changed.

Original comment by nbvF...@gmail.com on 2 Aug 2010 at 6:20

GoogleCodeExporter commented 9 years ago
I've been sitting on my own version of this for quite some time now. I'm 
attaching my patch with this comment.

I see the code nbvFOUR used to guess the LAME preset is the same code that I 
wrote for dnuos (also used in my patch).

Let me know if you think this approach is fine. If you're happy with it, I can 
go ahead and write tests to accompany the changes.

Original comment by brodie....@gmail.com on 19 Aug 2010 at 5:28

Attachments:

GoogleCodeExporter commented 9 years ago
Whoops, here's a SVN diff if you'd prefer that (I'm using hgsubversion and mq 
to work on the patch).

Original comment by brodie....@gmail.com on 19 Aug 2010 at 5:30

Attachments:

GoogleCodeExporter commented 9 years ago
Updated patch with better doc string and _guess_lame_preset moved into MPEGInfo 
as a method.

Original comment by brodie....@gmail.com on 19 Aug 2010 at 5:49

Attachments:

GoogleCodeExporter commented 9 years ago
Ph0b0x01, dnuos supports this as well.

Original comment by the.r3m0...@gmail.com on 13 Sep 2010 at 6:07

GoogleCodeExporter commented 9 years ago
Two notes - 

1. Please wrap all the unpack calls calls (and anything else that can throw an 
exception) some try/except wrappers. Otherwise parse errors in the LAME data (I 
don't know how common this is) will result in files that were previously 
readable becoming unreadable.

2. The logic in the "elif version >= (3, 90) and version < (3, 97):" case looks 
like it might be more suited for a dictionary or multidimensional dictionary 
than a nested conditional.

Otherwise, this looks good for inclusion once it has tests.

Original comment by joe.wreschnig@gmail.com on 17 Apr 2011 at 12:14

GoogleCodeExporter commented 9 years ago
I'm interested in this functionality (so that we can get info about the LAME 
presets in beets), so I'm going to try improving the patch for inclusion. For 
what it's worth, the patch applied just fine for me to present cloned master 
code!

Original comment by hch...@gmail.com on 11 Apr 2013 at 5:59

GoogleCodeExporter commented 9 years ago
I've added some try/except statements and a potential dictionary solution to 
the nested conditional you've mentioned... I'm interested in writing some 
tests, but none of the present MP3s in tests/data have LAME data. Are there any 
good guides to making tests, or at least data for these tests, for mutagen? I 
suppose I will have to get old versions of LAME and encode files with those as 
well?

Anyways, I've attached my altered patch. (I've never made patches like this 
before, so pardon if it's more trouble to work with than it should be)

Original comment by hch...@gmail.com on 12 Apr 2013 at 5:17

Attachments:

GoogleCodeExporter commented 9 years ago
I've added testing for the lame preset calculations into test_mp3.py, using the 
test data from dnuos. I'm glad to help alter/fix this further for any 
functional/legal/stylistic reasons. I've put my changes over in my mercurial 
fork https://bitbucket.org/hchapman/mutagen .

Original comment by hch...@gmail.com on 15 Apr 2013 at 4:17

GoogleCodeExporter commented 9 years ago
mutagen has moved to Bitbucket: https://bitbucket.org/lazka/mutagen/issue/66

Original comment by reiter.christoph@gmail.com on 4 Jul 2014 at 3:41