IPB

Welcome Guest ( Log In | Register )

MP3 repacker
Omion
post Mar 15 2005, 02:33
Post #1





Group: Developer
Posts: 432
Joined: 22-February 04
From: San Diego, CA
Member No.: 12180



What it does:
Attempts to save space by storing frame data in the smallest possible frame. Usually MP3s are already stored in the most efficient way possible. However, for high-bitrate CBR files (like --preset insane) there can be a lot of wasted space

psyllium has made a great Windows GUI for this program. The GUI thread is here. Many people will find it easier to use than the CLI, and it has a few more features too (recursive directory support, 2-pass CBR).

How to use:
Download this 7Z file (version 2.04) (mirror)
Extract to a directory that makes sense.
Type "mp3packer in.mp3 out.mp3" to repack the in.mp3 file
OR see mp3packer.html included in the package (or available here) for more options.
The source can be downloaded here (mirror).

Features:
* Can make --preset insane files up to 10% smaller LOSSLESSLY (depending on the LAME version used)
* Squeezes out all the padding it can from any MP3 (Will not produce a larger file, unless you use the -b switch or something goes wrong)
* Writes valid LAME/XING header for proper VBR seeking
* Many people also use this backwards, to losslessly turn VBR into larger CBR files to humor players which can't handle VBR
* Includes a brute-force compression optimization option as of 1.10 to further compress files
* Now supports Unicode file names and paths
* Support for encoding an entire directory of files
* Works on Windows, Linux, 64-bit Linux, Linux through WINE, and should work perfectly on any other platform with an OCaml port
* GPL, so anybody can tweak it as long as it stays GPL

A few caveats:
* The program will always output an MP3 that doesn't use CRCs, even if the input file uses CRC. This is primarily laziness on my part, but nobody really needs them, and it saves 600 bits per second... (it's a feature, not a bug!)
* The 32-bit version will not process files larger than 1GB. The 64-bit version has a much higher limitation (4EB) which is unlikely to be encountered.
* There seems to be an incompatibility with the multi-threaded repacking code and 32-bit Windows XP. If you run across an error, try adding "--workers 0" to the command line.

Changelog (click here!)

This post has been edited by Omion: Sep 1 2012, 04:34


--------------------
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
Go to the top of the page
+Quote Post
 
Start new topic
Replies
asonicboom
post May 16 2005, 07:34
Post #2





Group: Members
Posts: 2
Joined: 16-May 05
Member No.: 22086



Sorry to resurrect this thread on my first post but I really do like MP3 Packer and had a few questions...

Omion I use your program on all my old --preset insane files to remove tags and in the process shave a few kbits off the filesize. Am I right in saying that it also strips off any "bad last frames" that it encounters (I think you confirmed this in an earlier post) ?

When I recently tried to repack a 192kbps CBR mp3 Encspot showed the outputted file as having 224, 256 or 320 kpbs bit rates for some frames. Is this possible ? Is the mechanism similar to:
QUOTE (Omion @ Mar 15 2005, 02:33 AM)
If LAME decides a frame needs more then 320kbps, it will take the needed bits from the bit reservoir.... As of version 0.03, very large frames are identified early enough to pack the reservoir dynamically.

I sincerely hope you are still developing this great little proggie, batch processing and perhaps an executable and a GUI would be very welcome indeed wink.gif although I am perfecty content with the app in its current form (if anyone reading could compile MP3 Repacker into a stable binary or show me how to go about it I would be eternally grateful tongue.gif). As it is I currently use Florian's amazing MP3Tag program with mp3repacker inserted as a tool like so:
CODE
Name: MP3 Packer
Path: C:\WINDOWS\system32\cmd.exe
Parameter: /c "cd /d "E:\Backup\Programs\MP3 Packer\MP3 Packer v0.04" && perl mp3packer.pl -mst "%_path%" "%_folderpath%\%_filename%vbr.mp3""
with "for all selected files" ticked. Provided the user adjusts the absolute path to the two MP3 Packer files accordingly then it allows any number of mp3s in a directory to be packed to output files in the same folder but with vbr appended to the end of the filename by simply highlighting the mp3s, right clicking and selecting the MP3 Packer tool. This pseudo-batch processing comes in quite handy so I hope those instructions help anyone else in the same situation as me. Omion I was wondering if you could tell me if it's "safe" to run so many MP3 Packers concurrently ?

Lastly I was hoping you could tell me if you are aware of any bugs that would make running Mp3 Packer on all of my old unreplaceable mp3s a bad decision...

Thanks for all your hard work and effort smile.gif

--asonicboom
Go to the top of the page
+Quote Post
Omion
post May 17 2005, 10:02
Post #3





Group: Developer
Posts: 432
Joined: 22-February 04
From: San Diego, CA
Member No.: 12180



QUOTE (asonicboom @ May 15 2005, 11:34 PM)
Sorry to resurrect this thread on my first post but I really do like MP3 Packer and had a few questions...

Omion I use your program on all my old --preset insane files to remove tags and in the process shave a few kbits off the filesize. Am I right in saying that it also strips off any "bad last frames" that it encounters (I think you confirmed this in an earlier post) ?
If a bad last frame is encountered, it is simply added to the "non-MP3 junk at the end" category. That means that if you use the -s option the bad frame will be thrown out, otherwise it will be included but not optimized.
QUOTE (asonicboom @ May 15 2005, 11:34 PM)
When I recently tried to repack a 192kbps CBR mp3 Encspot showed the outputted file as having 224, 256 or 320 kpbs bit rates for some frames. Is this possible ? Is the mechanism similar to:
QUOTE (Omion @ Mar 15 2005, 02:33 AM)
If LAME decides a frame needs more then 320kbps, it will take the needed bits from the bit reservoir.... As of version 0.03, very large frames are identified early enough to pack the reservoir dynamically.
It is possible, expected, and happens quite a lot wink.gif . Due to the bit reservoir, the amount of data stored in an MP3 frame has very little relation to the bitrate of that frame. For example, here's a graph of a 192-CBR file. The red is the size of each frame (constant, of course) but the black dots are the actual amount of data in each frame. The blue is how many bits are in the reservoir per frame.

You can see that the bit reservoir is relatively large compared to the frame size; this means that data for one frame is far away from the actual frame header. The output of my program, though of similar size, has a much different structure:

You can see that there is less data in the reservoir, and the frames have sizes from 32-320kbps, depending on how much actual data there is. The top row of red dots is 320, the next one down is 256, etc.

QUOTE (asonicboom @ May 15 2005, 11:34 PM)
I sincerely hope you are still developing this great little proggie, batch processing and perhaps an executable and a GUI would be very welcome indeed wink.gif although I am perfecty content with the app in its current form (if anyone reading could compile MP3 Repacker into a stable binary or show me how to go about it I would be eternally grateful tongue.gif).
I've been trying to figure out how to make binaries from Perl, but my Perl doesn't seem to want to.

I don't have any experience or desire to make a GUI for the program, but if you want to, feel free wink.gif .
QUOTE (asonicboom @ May 15 2005, 11:34 PM)
As it is I currently use Florian's amazing MP3Tag program with mp3repacker inserted as a tool like so:
CODE
Name: MP3 Packer
Path: C:\WINDOWS\system32\cmd.exe
Parameter: /c "cd /d "E:\Backup\Programs\MP3 Packer\MP3 Packer v0.04" && perl mp3packer.pl -mst "%_path%" "%_folderpath%\%_filename%vbr.mp3""
with "for all selected files" ticked. Provided the user adjusts the absolute path to the two MP3 Packer files accordingly then it allows any number of mp3s in a directory to be packed to output files in the same folder but with vbr appended to the end of the filename by simply highlighting the mp3s, right clicking and selecting the MP3 Packer tool. This pseudo-batch processing comes in quite handy so I hope those instructions help anyone else in the same situation as me. Omion I was wondering if you could tell me if it's "safe" to run so many MP3 Packers concurrently ?
As long as you don't have them writing to the same file, running multiple repackers in parallel isn't a problem. (If you do have them writing to the same file, they won't corrupt it; they'll just exit with a "permission denied" error)
QUOTE (asonicboom @ May 15 2005, 11:34 PM)
Lastly I was hoping you could tell me if you are aware of any bugs that would make running Mp3 Packer on all of my old unreplaceable mp3s a bad decision...
I don't know of any bugs in the program; it seems fairly stable. However, if you want to extra assurance, you can run the input and output files through Foobar's "bit-compare files". If that says they're OK, then you can delete the old one. If it says they're different, then post to this thread, as it would indicate a bug.

QUOTE (asonicboom @ May 15 2005, 11:34 PM)
Thanks for all your hard work and effort smile.gif

--asonicboom
*
Thank you for the feedback! It's good to know that people are using my program.

[edit from 7 years in the future: fixed the images to point to my current server]

This post has been edited by Omion: Aug 2 2012, 06:05


--------------------
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
Go to the top of the page
+Quote Post
halb27
post Nov 7 2005, 15:56
Post #4





Group: Members
Posts: 2414
Joined: 9-October 05
From: Dormagen, Germany
Member No.: 25015



QUOTE (Omion @ May 17 2005, 11:02 AM)
... The red is the size of each frame (constant, of course) but the black dots are the actual amount of data in each frame. The blue is how many bits are in the reservoir per frame. ...
*

How did you produce this graph? Very interesting to me as I'm interested a lot in the maximum actual frame size producable by encoders especially Lame 3.90.3 api and -b320. You show already that actual frame size can be more than the size of a 320 kbps frame (minus frame header minus side info).
(I'm interested in differences between Lame 3.90.3 and 3.96.1/3.97b when using cbr320. There is some evidence that 3.90.3 cbr320 provides better quality. 3.96+ doesn't use bit reservoir which restricts actual frame size to the size of a 320 kbps frame minus frame header minus side info. 3.90.3 however does use the bit reservoir but it is unclear with which restriction concerning maximum actual frame size.)

This post has been edited by halb27: Nov 7 2005, 16:13


--------------------
lame3100m --bCVBR 300
Go to the top of the page
+Quote Post

Posts in this topic
- Omion   MP3 repacker   Mar 15 2005, 02:33
- - Lyx   what about gapless playback? Will anything in the ...   Mar 15 2005, 02:44
|- - Omion   QUOTE (Lyx @ Mar 14 2005, 06:44 PM)what about...   Mar 15 2005, 04:02
- - Jojo   that's some pretty pimp stuff...does it handle...   Mar 15 2005, 19:18
|- - Omion   QUOTE (Jojo @ Mar 15 2005, 11:18 AM)that...   Mar 15 2005, 20:29
- - Qest   Sounds pretty cool. I wouldn't have thought th...   Mar 15 2005, 21:05
|- - Omion   QUOTE (Qest @ Mar 15 2005, 01:05 PM)Sounds pr...   Mar 15 2005, 21:59
|- - krmathis   QUOTE (Omion @ Mar 15 2005, 09:59 PM)@solaris...   Mar 16 2005, 09:05
- - Jebus   So, basically this program turns a CBR file into a...   Mar 15 2005, 21:14
|- - Omion   QUOTE (Jebus @ Mar 15 2005, 01:14 PM)So, basi...   Mar 15 2005, 22:04
- - krmathis   Seems to work fine. I just tested it on some rand...   Mar 15 2005, 21:54
- - Mo0zOoH   Binary, anyone?   Mar 15 2005, 23:32
- - Klyith   QUOTE (Mo0zOoH @ Mar 15 2005, 06:32 PM)Binary...   Mar 16 2005, 00:31
|- - 2thumbs   QUOTE (Klyith @ Mar 15 2005, 03:31 PM)QUOTE (...   Mar 16 2005, 00:43
- - Mo0zOoH   CODEC:\Files\progs\Lame stuff...   Mar 18 2005, 07:28
|- - Omion   QUOTE (Mo0zOoH @ Mar 17 2005, 11:28 PM)CODEC...   Mar 18 2005, 11:22
|- - Omion   QUOTE (Mo0zOoH @ Mar 17 2005, 11:28 PM)CODEC...   Mar 19 2005, 05:10
- - sven_Bent   couldn't this funktion be put into lame ? some...   Mar 18 2005, 07:35
- - sven_Bent   just tried this. Saved a couple of bytes. However ...   Mar 18 2005, 07:59
|- - smack   @Omion Thanks for the great tool! QUOTE (sve...   Mar 18 2005, 08:56
||- - Omion   QUOTE (smack @ Mar 18 2005, 12:56 AM)@Omion T...   Mar 18 2005, 11:04
||- - sven_Bent   @ominion i dont have fobar her but i did two disk...   Mar 18 2005, 22:29
||- - Lyx   edit: nevermind - i misunderstood something.   Mar 18 2005, 22:40
||- - Omion   QUOTE (sven_Bent @ Mar 18 2005, 02:29 PM)@omi...   Mar 20 2005, 03:29
|- - kjoonlee   QUOTE (sven_Bent @ Mar 18 2005, 03:59 PM)just...   Mar 18 2005, 09:25
- - DreamTactix291   The way I'd describe the output of the songs I...   Mar 18 2005, 08:03
- - Mo0zOoH   Okay, version 0.02 works. But still with some issu...   Mar 20 2005, 12:43
|- - Omion   QUOTE (Mo0zOoH @ Mar 20 2005, 04:43 AM)Okay, ...   Mar 20 2005, 23:33
- - Mo0zOoH   It works now, but only with -p 250 or more, the re...   Mar 22 2005, 20:55
- - Jojo   I haven't had the chance yet to give it a try....   Mar 22 2005, 21:55
- - Omion   QUOTE (Mo0zOoH @ Mar 22 2005, 12:55 PM)It wor...   Mar 23 2005, 00:40
- - Omion   Just released version 0.03. Now you no longer need...   Mar 25 2005, 04:36
- - kevinsham   I get this error for one file On frame 7435 of 75...   Mar 25 2005, 07:31
|- - Antonski   QUOTE (kevinsham @ Mar 25 2005, 09:31 AM)I ge...   Mar 25 2005, 19:40
|- - Omion   QUOTE (Antonski @ Mar 25 2005, 11:40 AM)QUOTE...   Mar 26 2005, 08:20
|- - Antonski   QUOTE (kevinsham @ Mar 25 2005, 09:31 AM)Can ...   Mar 26 2005, 13:15
- - Lyx   @Omion Would it be possible to add a parameter to...   Mar 25 2005, 12:09
- - djdance   Boys, please let me simply download .EXE without a...   Mar 26 2005, 06:03
- - kjoonlee   Um, you don't need a repacker binary. Use perl...   Mar 26 2005, 06:39
- - kjoonlee   For chopping, I use dd from GNU coreutils. dd if=...   Mar 26 2005, 09:56
- - Mo0zOoH   0.3 works good for me, thanks.   Mar 26 2005, 10:40
- - Omion   Released version 0.04. Hopefully the previous ...   Mar 30 2005, 00:04
- - Antonski   Hi Reed, I'm afraid I've encounered a new...   Apr 16 2005, 21:32
|- - Omion   @Antonski - Hmm.... That's where the program d...   Apr 16 2005, 22:01
|- - Antonski   QUOTE (Omion @ Apr 17 2005, 12:01 AM)Try repl...   Apr 16 2005, 22:32
- - Deep_Elem   I've been tinkering with v.0.04 using the late...   Apr 17 2005, 19:46
|- - Omion   1. That's weird. If the input files have LAME ...   Apr 18 2005, 00:32
- - asonicboom   Sorry to resurrect this thread on my first post bu...   May 16 2005, 07:34
|- - Omion   QUOTE (asonicboom @ May 15 2005, 11:34 PM)Sor...   May 17 2005, 10:02
|- - halb27   QUOTE (Omion @ May 17 2005, 11:02 AM)... The ...   Nov 7 2005, 15:56
|- - smack   QUOTE (halb27 @ Nov 7 2005, 03:56 PM)How did ...   Nov 8 2005, 11:44
|- - Omion   QUOTE (halb27 @ Nov 7 2005, 07:56 AM)How did ...   Nov 8 2005, 20:43
|- - halb27   QUOTE (Omion @ Nov 8 2005, 09:43 PM)I don...   Nov 8 2005, 23:14
- - asonicboom   Thanks for replying so soon and so comprehensively...   May 18 2005, 03:53
- - Firon   Hmm, I seem to be having a strange issue with the ...   Dec 18 2005, 02:34
|- - Omion   Very strange. I'll take a look. (and see if I ...   Dec 19 2005, 09:56
- - Firon   Well, the tags were made by foobar2000 (I'd re...   Dec 22 2005, 10:31
|- - Omion   Which version of the ID3v2-wrinting component do y...   Dec 22 2005, 22:41
- - Firon   I've got version 1.20, which I nabbed off kode...   Dec 23 2005, 00:15
|- - Merlin744   I am really impressed by this program. It convert...   Jan 15 2006, 04:38
|- - Omion   Well, it converts faster than EAC because it doesn...   Jan 15 2006, 07:44
|- - Merlin744   QUOTE (Omion @ Jan 15 2006, 01:44 AM)Well, it...   Jan 16 2006, 10:54
- - jaybeee   CODEName: MP3 Packer Path: C:\WIN...   Jan 16 2006, 15:21
- - senab   jaybee: Make sure you've got Omion's Perl...   Jan 16 2006, 20:44
|- - Omion   QUOTE (senab @ Jan 16 2006, 12:44 PM)And than...   Jan 16 2006, 21:34
- - senab   QUOTE (Omion @ Jan 16 2006, 09:34 PM)That was...   Jan 16 2006, 22:03
|- - Omion   QUOTE (senab @ Jan 16 2006, 02:03 PM)I do tur...   Jan 16 2006, 22:18
- - jaybeee   Many thanks senab. Works like a charm. And thank...   Jan 16 2006, 22:12
|- - Omion   QUOTE (jaybeee @ Jan 16 2006, 02:12 PM)And th...   Jan 17 2006, 09:00
|- - jaybeee   QUOTE (Omion @ Jan 17 2006, 08:00 AM)Do you k...   Jan 17 2006, 18:13
|- - Omion   Kay, 0.07's out, and adds full-directory proce...   Jan 18 2006, 07:46
- - Merlin744   this is an amazing tool!! I think everyone...   Jan 20 2006, 11:24
- - jaybeee   ^^ I'm confused: I thought it made CBR files V...   Jan 20 2006, 17:30
|- - Madrigal   QUOTE (jaybeee @ Jan 20 2006, 11:30 AM)^^ I...   Jan 20 2006, 17:46
|- - Omion   QUOTE (jaybeee @ Jan 20 2006, 09:30 AM)^^ I...   Jan 20 2006, 20:27
- - Merlin744   I was so sad when I first read that pioneer forum ...   Jan 20 2006, 23:49
|- - psyllium   QUOTE (Merlin744 @ Jan 21 2006, 08:49 AM)I wa...   Jan 21 2006, 11:13
- - Omion   Just released 0.08. If you don't use the -b sw...   Jan 25 2006, 08:59
- - robert   padding is only needed for CBR at 44.1, 22.05 or 1...   Jan 25 2006, 23:30
- - psyllium   A new version, 0.3 beta, of WinMP3Packer has been ...   Jan 26 2006, 03:04
- - Omion   Released 0.09. Better support for whole directori...   Jan 27 2006, 05:43
|- - psyllium   QUOTE (Omion @ Jan 27 2006, 03:43 PM)Then com...   Feb 2 2006, 16:25
- - jaybeee   Getting this error: CODEERROR: Can't run f...   Feb 8 2006, 22:01
|- - Omion   That sounds like what Firon's problem on post ...   Feb 9 2006, 07:35
|- - jaybeee   QUOTE (Omion @ Feb 9 2006, 06:35 AM)That soun...   Feb 12 2006, 11:03
|- - Omion   QUOTE (jaybeee @ Feb 12 2006, 03:03 AM)Now, I...   Feb 12 2006, 21:02
|- - jaybeee   QUOTE (Omion @ Feb 12 2006, 08:02 PM)PS. What...   Feb 12 2006, 21:19
- - kevinsham   I am constantly getting this error message: Wide ...   Feb 12 2006, 08:10
|- - Omion   Hmmm... that's where the program writes the LA...   Feb 12 2006, 08:33
- - UED77   Omion, I love your program, but I've been havi...   Feb 12 2006, 09:10
|- - Omion   QUOTE (UED77 @ Feb 12 2006, 01:10 AM)Omion, I...   Feb 12 2006, 09:51
- - kevinsham   It seems that mp3packer is chopping the file. See ...   Feb 12 2006, 10:11
|- - Omion   QUOTE (kevinsham @ Feb 12 2006, 02:11 AM)It s...   Feb 12 2006, 10:34
|- - kevinsham   QUOTE (Omion @ Feb 12 2006, 05:34 PM)QUOTE (k...   Feb 12 2006, 11:25
- - UED77   Okay, I commented out line 804, like you suggested...   Feb 12 2006, 20:10
- - Omion   0.10 out. Just a bugfix. All the recent gripes sho...   Feb 13 2006, 09:27
|- - jaybeee   QUOTE (Omion @ Feb 13 2006, 08:27 AM)0.10 out...   Feb 13 2006, 11:16
- - kevinsham   A feature request: Rename the original file and us...   Feb 13 2006, 14:21
|- - jaybeee   QUOTE (kevinsham @ Feb 13 2006, 01:21 PM)A fe...   Feb 13 2006, 14:28
- - MuncherOfSpleens   Hmm, when using this I get the error message ...   Feb 13 2006, 20:27
6 Pages V   1 2 3 > » 


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th April 2014 - 22:47