MP3 repacker |
![]() ![]() |
MP3 repacker |
Jan 29 2011, 23:46
Post
#476
|
|
|
Winamp Developer Group: Developer Posts: 662 Joined: 17-July 05 From: Ashburn, VA Member No.: 23375 |
It looks like the problem stems from the data inside the LAME tag. The file was encoded with ABR, so that was what was in the initial LAME tag. mp3packer treats the LAME tag as information about how the file was encoded, so keeps it the same as the input file. What probably happened is that Winamp saw the ABR in the LAME header and reported that information. I have no idea why Winamp would say that the number of frames would change so drastically on deleting the first frame. MP3s do not store their length or bitrate anywhere (except in the non-standard XING/LAME header) so it's possible that Winamp had to guess. Oddly enough, what it guessed is exactly 1/8 the actual number of frames (well, rounded to the nearest whole number). It sort of looks like Winamp mistook bits for bytes somewhere in the process. In conclusion, it looks like Winamp is correctly reporting the encoding setting as opposed to actually checking the frames of the file. (technically CBR is a subset of ABR, so calling it ABR is true, but that's splitting hairs). So in the end, nothing's wrong Thanks for the report. I fixed the issue with the frame approximation. When there is no Xing, LAME or VBRI header present, it's totally a guess, as you had suspected. Luckily, VBR mp3 files without one of these headers is relatively rare. And, yes, it's reporting ABR because that's how it was defined in the LAME info tag. Ideally MP3 repacker could change the encoding type bits in the LAME header to reflect the changes. I assume it already rebuilds the seektable. Also, yes for clarification, the LAME header isn't counted in the frame count nor does it count in the "Header found at" reporting. |
|
|
|
Jan 30 2011, 04:51
Post
#477
|
|
|
Group: Members Posts: 581 Joined: 12-May 06 From: Colorado, USA Member No.: 30694 |
|
|
|
|
Jan 31 2011, 08:49
Post
#478
|
|
|
Group: Members Posts: 36 Joined: 25-January 09 Member No.: 65946 |
...If anyone knows the right way to make this context menu item only show up for mp3 files, let me know. I tried changing the '*' to '.mp3' or 'mp3file' or 'mpegfile', but none of those seemed to work. Probably mp3file is not registered on your system. I've checked mine, it seems that wmplayer has registered that type, so I've just added a new shell extension, see below: CODE Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\mp3file] "PreferExecuteOnMismatch"=dword:00000001 "EditFlags"=hex:00,00,01,00 @="MP3 Format Sound" "FriendlyTypeName"="@C:\\WINDOWS\\inf\\unregmp2.exe,-9925" [HKEY_CLASSES_ROOT\mp3file\DefaultIcon] @="C:\\PROGRA~1\\WINDOW~2\\wmplayer.exe,-120" [HKEY_CLASSES_ROOT\mp3file\shell] @="play" [HKEY_CLASSES_ROOT\mp3file\shell\&Repack_with_mp3packer] @="&Repack with mp3packer" [HKEY_CLASSES_ROOT\mp3file\shell\&Repack_with_mp3packer\command] @="D:\\Util\\mp3repacker\\mp3packer.exe -z -u --nice 1 -a \"-old\" \"%1\"" [HKEY_CLASSES_ROOT\mp3file\shell\&Repack_with_mp3packer\ddeexec] [HKEY_CLASSES_ROOT\mp3file\shell\&Repack_with_mp3packer\ddeexec\Application] @="mp3packer" [HKEY_CLASSES_ROOT\mp3file\shell\&Repack_with_mp3packer\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\mp3file\shell\open] @="&Open" "LegacyDisable"="" [HKEY_CLASSES_ROOT\mp3file\shell\open\command] @="\"C:\\Program Files\\Windows Media Player\\wmplayer.exe\" /prefetch:6 /Open \"%L\"" [HKEY_CLASSES_ROOT\mp3file\shell\open\DropTarget] "CLSID"="{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}" [HKEY_CLASSES_ROOT\mp3file\shell\play] "MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\ 6f,00,74,00,25,00,5c,00,69,00,6e,00,66,00,5c,00,75,00,6e,00,72,00,65,00,67,\ 00,6d,00,70,00,32,00,2e,00,65,00,78,00,65,00,2c,00,2d,00,39,00,39,00,39,00,\ 31,00,00,00 @="&Play" "LegacyDisable"="" [HKEY_CLASSES_ROOT\mp3file\shell\play\command] @="\"C:\\Program Files\\Windows Media Player\\wmplayer.exe\" /prefetch:6 /Play \"%L\"" Hope this helps... |
|
|
|
Apr 5 2011, 23:12
Post
#479
|
|
|
Group: Members Posts: 1 Joined: 5-April 11 Member No.: 89583 |
Hey, here's a unixy binary of 1.20, compiled on osx 10.4.11 (intel) I'll whip up a gui and post that in a bit. http://alexyule.com/softwares/mp3packer.gz EDIT: Gui is now up, use it via drag-n-drop (multiple files supported). Each file will be processed, and the resulting output will go to the same folder with -vbr added to the song name. i.e. 22 Acacia Ave.mp3 --> 22 Acacia Ave-vbr.mp3 Self-contained GUI is here: http://alexyule.com/softwares/mp3packerX_v1.20.zip Automator action to rename the vbr files (overwriting the originals) via drag-n-drop (you can just drag all the files and it will only rename the -vbr ones) is here: http://alexyule.com/softwares/mp3packer_renamer.zip Hey Apoc_Metal (or anyone else who can help!) I have been trying to get version 1.2 of the mp3packer program to run on my Mac but haven't had any luck so far. I've been using Terminal to try to launch it - but it gave me a message saying "no application knows how to open Desktop/mp3packer" after that I tried adding the extention .app to the filename, but then I got a error code in the Terminal window after I tried to open it again. I'm not very knowledgeable about working with the Terminal window... any suggestions would be appreciated. Would be especially interested in learning how to get the GUI working, once the mp3packer itself is running of course ! My Mac is a Duo core Intel running OS X 10.5.8 by the way... This post has been edited by Code: Apr 5 2011, 23:13 |
|
|
|
Apr 11 2011, 22:09
Post
#480
|
|
|
Group: Members Posts: 40 Joined: 6-November 06 Member No.: 37260 |
Forgive me if this has been discussed before in this thread as I didn't feel like going through 20 pages to find out...
I was running mp3repacker on the mp3 soundtrack of a TV series, and I just found out by accident that apparently mp3packer writes a header like "mp3packer1.21-229" several times into the packed mp3. Sorry if this sounds stingy but, isn't this wasted space? I mean, I thought the whole point of mp3packer was to try to reduce the stream by every byte possible... Or am I missing something? Presuming it writes that for every frame, that's 17 bytes per frame. The soundtrack in question had 106,000 frames, and doing the math, that's like 1.8 MBs It might not sound like much, but the soundtrack is a low bitrate mono mp3 weighing only 10MB. Which means 18% are wasted bits... Now I'm not sure mp3packer really writes that for every frame, but if it does, it seems like a lot of wasted bits... Is this correct, or did I get it wrong somewhere? |
|
|
|
May 16 2011, 09:52
Post
#481
|
|
|
Group: Members Posts: 9 Joined: 25-June 03 Member No.: 7388 |
Hey, here's a unixy binary of 1.20, compiled on osx 10.4.11 (intel) I'll whip up a gui and post that in a bit. http://alexyule.com/softwares/mp3packer.gz EDIT: Gui is now up, use it via drag-n-drop (multiple files supported). Each file will be processed, and the resulting output will go to the same folder with -vbr added to the song name. i.e. 22 Acacia Ave.mp3 --> 22 Acacia Ave-vbr.mp3 Self-contained GUI is here: http://alexyule.com/softwares/mp3packerX_v1.20.zip Automator action to rename the vbr files (overwriting the originals) via drag-n-drop (you can just drag all the files and it will only rename the -vbr ones) is here: http://alexyule.com/softwares/mp3packer_renamer.zip Hey Apoc_Metal (or anyone else who can help!) I have been trying to get version 1.2 of the mp3packer program to run on my Mac but haven't had any luck so far. I've been using Terminal to try to launch it - but it gave me a message saying "no application knows how to open Desktop/mp3packer" after that I tried adding the extention .app to the filename, but then I got a error code in the Terminal window after I tried to open it again. I'm not very knowledgeable about working with the Terminal window... any suggestions would be appreciated. Would be especially interested in learning how to get the GUI working, once the mp3packer itself is running of course ! My Mac is a Duo core Intel running OS X 10.5.8 by the way... Hm, seems that gzipped version of the binary is messed up... but the osx front-end has a working version stored inside the application package, so it should work just fine! Anyone who wants the binaries can grab them here http://omion.dyndns.org/mp3packer/ there's an updated version 1.21 that I haven't tried since I can't get it to compile (I have no idea what I'm doing This post has been edited by apoc_metal: May 16 2011, 10:29 |
|
|
|
May 16 2011, 20:37
Post
#482
|
|
|
Group: Members Posts: 9 Joined: 25-June 03 Member No.: 7388 |
Alrighty, I've updated my rudimentary OSX GUI with a 1.21 binary.
USAGE: Drag a bunch of mp3's onto the app, then wait. Then run the automator action to rename the files or do it by hand... Currently the app does NOT handle pathnames with single quotes in them. All files can be found here: http://alexyule.com/softwares I've also posted the binary itself, compiled on an intel mac running OSX, not sure what other platforms it'll run on... |
|
|
|
May 18 2011, 16:03
Post
#483
|
|
|
Group: Members Posts: 107 Joined: 3-April 09 Member No.: 68627 |
I was running mp3repacker on the mp3 soundtrack of a TV series, and I just found out by accident that apparently mp3packer writes a header like "mp3packer1.21-229" several times into the packed mp3. Sorry if this sounds stingy but, isn't this wasted space? A late reply is better than no reply. This is not a "header", but the "filler". The mp3 standard defines fixed set of allowed bitrates on a per-frame basis. Particularly, the minimum allowed bitrate is 32 kilobits per second - even if the stream can be compressed further, the relevant frame still has to be padded with extra bits to fulfill the minimum allowed bitrate requirement. This requirement of the standard imposes the minimum (as well as maximum) allowed frame size restriction depending on the encoding process history and current state. In other words, some frames can not get smaller than certain size, even when there is no audio data to encode into that space. The payload in such frames can be filled with arbitrary bits; mp3repacker fills it with the version info string. So there is no waste of space, mp3repacker always produces the most compact specification-compliant stream possible. |
|
|
|
May 18 2011, 16:26
Post
#484
|
|
|
Group: Members Posts: 44 Joined: 6-February 11 Member No.: 87966 |
QUOTE Particularly, the minimum allowed bitrate is 32 kilobits per second - even if the stream can be compressed further, the relevant frame still has to be padded with extra bits to fulfill the minimum allowed bitrate requirement. Actually mpeg-2 layer 3 defines minimal bitrate of 8 kbps and IIRC 8kbps files are smaller than 32 kbps, am I wrong? |
|
|
|
May 18 2011, 17:11
Post
#485
|
|
![]() Group: Developer Posts: 2983 Joined: 2-December 07 Member No.: 49183 |
It's not possible to losslessly convert MPEG-1 layer 3 to MPEG-2 layer 3.
|
|
|
|
May 18 2011, 18:47
Post
#486
|
|
![]() Group: Members Posts: 347 Joined: 22-September 04 From: Moscow Member No.: 17192 |
Can those bits be used for bit reservoir, or is it not possible?
-------------------- Infrasonic Quartet + Sennheiser HD650 + Microlab Solo 2 mk3.
|
|
|
|
May 19 2011, 15:10
Post
#487
|
|
|
Group: Members Posts: 107 Joined: 3-April 09 Member No.: 68627 |
|
|
|
|
Jun 27 2011, 07:45
Post
#488
|
|
![]() Group: Developer Posts: 432 Joined: 22-February 04 From: San Diego, CA Member No.: 12180 |
I'm not quite dead!
Someone traversed the internet to send me some problem files, so in response I came out with version 1.22. I also decided to post a mirror on my Dropbox account, in case my home server gives up the ghost again. The source is here (mirror). The biggest problem was that one of my string-initialization routines would cause an out-of-bounds access with a very specific type of corrupted frame. I also discovered a case when the -z switch would not process the input properly, causing a small number of corrupted frames to not be processed. The program now shows the number of decompression errors in the bitstream that the -z switch has encountered. I had the code in there for years, but for some reason I never did anything with it. The processing of corrupted frames by the -z switch means that there may be some changes to the audio on those frames. In my experience, the changes are limited to the 1 or 2 highest-frequency samples encoded. These changes will ONLY ever occur on corrupted or otherwise invalid frames, not valid ones. They will be accompanied by a "decompression error" warning. [edit]Woo! I can edit now! Main post updated. This post has been edited by Omion: Jun 27 2011, 20:02 -------------------- "We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
|
|
|
|
Jul 14 2011, 15:51
Post
#489
|
|
|
Group: Members Posts: 50 Joined: 17-April 08 Member No.: 52847 |
thank you!
possible icl version? |
|
|
|
Jul 14 2011, 16:46
Post
#490
|
|
![]() Group: Developer Posts: 2983 Joined: 2-December 07 Member No.: 49183 |
|
|
|
|
Jul 14 2011, 17:04
Post
#491
|
|
|
Group: Members Posts: 50 Joined: 17-April 08 Member No.: 52847 |
I do not know
|
|
|
|
Jul 14 2011, 22:43
Post
#492
|
|
![]() Group: Developer Posts: 432 Joined: 22-February 04 From: San Diego, CA Member No.: 12180 |
thank you! possible icl version? No ICL version, unfortunately. As lvqcl implied, there is no way to compile OCaml with ICL. I am trying to put together a multi-threaded(*) version for batch processing, which should help with today's multi-core CPUs (it wasn't as much of an issue when I started this in 2004 (*) Well, technically OCaml can't really speed up things when multi-threading, so I'm really trying to get multiple processes running simultaneously. It's a bit trickier than multi-threading, so I'm running a lot of tests before releasing it. -------------------- "We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
|
|
|
|
Jul 15 2011, 07:48
Post
#493
|
|
![]() Group: Members Posts: 195 Joined: 8-October 01 From: Sofia, Bulgaria Member No.: 250 |
(*) Well, technically OCaml can't really speed up things when multi-threading, so I'm really trying to get multiple processes running simultaneously. It's a bit trickier than multi-threading, so I'm running a lot of tests before releasing it. I think running parallel processes in Perl is much easier than multi-threading, but I guess you don't want to go back to Perl, right? |
|
|
|
Jul 15 2011, 12:07
Post
#494
|
|
|
Group: Members Posts: 50 Joined: 17-April 08 Member No.: 52847 |
Thanks for the continued development
|
|
|
|
Jul 16 2011, 04:17
Post
#495
|
|
![]() Group: Developer Posts: 432 Joined: 22-February 04 From: San Diego, CA Member No.: 12180 |
(*) Well, technically OCaml can't really speed up things when multi-threading, so I'm really trying to get multiple processes running simultaneously. It's a bit trickier than multi-threading, so I'm running a lot of tests before releasing it. I think running parallel processes in Perl is much easier than multi-threading, but I guess you don't want to go back to Perl, right? Yeah, Perl would be terribly slow, especially for the -z stuff. And I'm much more used to OCaml now than Perl. -------------------- "We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
|
|
|
|
Aug 13 2011, 00:08
Post
#496
|
|
![]() Group: Members Posts: 42 Joined: 23-May 08 From: Rzeczpospolita Member No.: 53744 |
mp3packer 1.22-230
Fatal error: exception Invalid_argument("String.sub") Example mp3 - http://www.multiupload.com/IBM89OEUQ1 |
|
|
|
Aug 15 2011, 02:24
Post
#497
|
|
![]() Group: Developer Posts: 432 Joined: 22-February 04 From: San Diego, CA Member No.: 12180 |
mp3packer 1.22-230 Fatal error: exception Invalid_argument("String.sub") Example mp3 - http://www.multiupload.com/IBM89OEUQ1 Thanks for the report. I just released 1.23 to fix it. (download) (mirror) I'm sure I've fixed this bug about 5 times before, but it keeps coming back in slightly different ways. Hopefully it stays fixed this time. -------------------- "We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
|
|
|
|
Aug 15 2011, 08:10
Post
#498
|
|
![]() Group: Members Posts: 42 Joined: 23-May 08 From: Rzeczpospolita Member No.: 53744 |
|
|
|
|
Oct 20 2011, 04:33
Post
#499
|
|
|
Group: Members Posts: 40 Joined: 6-November 06 Member No.: 37260 |
I'm trying to compile it under Fedora 15 64-bit, and I'm getting the following error:
CODE $ make OBJ_EXT=.o ocamlopt -c crc.ml ocamlopt list2.mli ocamlopt -c list2.ml ocamlopt expandarray.mli ocamlopt -c expandarray.ml ocamlopt c_part.c ocamlopt -c mp3types.ml ocamlopt -c pack.ml ocamlopt -c mp3read.ml File "mp3read.ml", line 172, characters 7-18: Warning 26: unused variable return_none. File "mp3read.ml", line 76, characters 35-40: Warning 16: this optional argument cannot be erased. ocamlopt -c mp3write.ml ocamlopt -c mp3info.ml ocamlopt -c mp3types.cmx pack.cmx mp3framehuffman.ml ocamlopt -c mp3types.cmx pack.cmx mp3framehuffman.cmx mp3frameutils.ml ocamlopt -c mp3queue.ml File "mp3queue.ml", line 312, characters 6-18: Warning 26: unused variable bitrate_list. File "mp3queue.ml", line 361, characters 5-18: Warning 26: unused variable print_bitrate. File "mp3queue.ml", line 347, characters 5-26: Warning 26: unused variable update_side_reservoir. File "mp3queue.ml", line 115, characters 5-13: Warning 26: unused variable debug_in. File "mp3queue.ml", line 420, characters 28-2840: Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: {side_bits=[| |]} File "mp3queue.ml", line 479, characters 18-2324: Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: {side_bits=[| |]} File "mp3queue.ml", line 538, characters 24-1361: Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: {side_bits=[| |]} File "mp3queue.ml", line 577, characters 14-1514: Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: {side_bits=[| |]} ocamlopt -c multiproc.ml File "multiproc.ml", line 163, characters 3-65: Warning 5: this function application is partial, maybe some arguments are missing. File "multiproc.ml", line 219, characters 3-65: Warning 5: this function application is partial, maybe some arguments are missing. File "multiproc.ml", line 359, characters 5-88: Warning 10: this expression should have type unit. ocamlopt -o mp3packer.exe unix.cmxa str.cmxa crc.cmx list2.cmx expandarray.cmx c_part.o mp3types.cmx pack.cmx mp3read.cmx mp3write.cmx mp3info.cmx mp3framehuffman.cmx mp3frameutils.cmx mp3queue.cmx multiproc.cmx mp3packer.ml File "mp3packer.ml", line 331, characters 8-14: Warning 26: unused variable errors. File "mp3packer.ml", line 335, characters 8-14: Warning 26: unused variable errors. ocamlopt -o mp3reader.exe unix.cmxa crc.cmx list2.cmx c_part.o mp3types.cmx pack.cmx mp3read.cmx mp3reader.ml File "mp3reader.ml", line 1, characters 0-1: Error: No implementations provided for the following modules: Str referenced from mp3types.cmx make: *** [mp3reader] Error 2 Any ideas? This post has been edited by db1989: Oct 21 2011, 12:44
Reason for edit: Please enclose large bodies of text in [codebox]these[/codebox].
|
|
|
|
Oct 20 2011, 07:01
Post
#500
|
|
![]() Group: Developer Posts: 432 Joined: 22-February 04 From: San Diego, CA Member No.: 12180 |
@stereotype:
It looks like I haven't updated the mp3reader dependencies in the makefile. You can fix it by adding "str.cmxa" after "unix.cmxa" in the mp3reader line of the makefile: CODE <TAB>ocamlopt -o mp3reader$(EXE_EXT) unix.cmxa str.cmxa crc.cmx list2.cmx c_part$(OBJ_EXT) mp3types.cmx pack.cmx mp3read.cmx mp3reader.ml (the <TAB> at the beginning should be an actual tab) However, you probably don't need mp3reader at all. It's just a program to output MP3 statistics in a Mathematica-style format. Run this to just make mp3packer: CODE make mp3packer OBJ_EXT=.o -------------------- "We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd May 2013 - 03:20 |