MP3packer is a program which can rearrange the data within an MP3 to fulfill specific goals. By default, the program generates the smallest MP3 possible (with the least padding). However, many people also use it to turn VBR files into CBR for use with players which don't support VBR.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Please see gpl.txt for more details. Source code for this program should be available from the same place as the compiled version.
mp3packer
[ options
] in.mp3
[ out
]
Processes in.mp3
according to options
and saves the output to out
. If out
is a directory, mp3packer will keep the same name as in
but in the out
directory. If out
is not given, the -a
string will be appended to the file name (see below).
mp3packer
[ options
] inDir
[ outDir
]
Processes all files ending in ".mp3" in the directory
inDir
. This is not recursive. If outDir
is given, all output files will have the same name in the outDir
directory. If outDir
is not given, the files will have the -a
string appended to them, and will stay in inDir
.
options
, if specified, may be any of the following:
-b #
-b 129
will result in the smallest allowed frame size being a padded 128kbps frame. -b 117
will result in the smallest allowed frame size being an unpadded 128kbps frame. If -b 128
is used with 44100Hz files, the minimum bitrate will depend on the frame number. Assuming 44100Hz, for 2 frames out of 49 the minimum frame will be unpadded, for the other 47 it will be padded. All bitrates from 114 to 127 will result in the smallest frame being an unpadded 128kbps frame. -t
-s
and -t
to remove all tags.-s
-z
-z
switch, but it increases the time to repack the files dramatically. On my computer, a 4-minute file which would get repacked in the blink of an eye would take around 30 seconds with this option enabled.-a "-vbr"
mp3packer -a "-food" in.mp3
is given, the output will be named in-food.mp3
. "-vbr"
is the default.-u
mp3packer -u process.mp3 backup.mp3
, the file process.mp3
will contain the packed mp3, and backup.mp3
will be the same as the original process.mp3
. Note that if you don't specify an output file or change the -a
option, the original will have "-vbr"
appended to it, which may lead to confusion.-f
-u
option, it will force overwriting the backup file. --keep-ok
[ out
| both
]out
will only keep the output file and will delete the input file, whereas both
will keep both files (the default)--keep-bad
[ in
| out
| both
]in
will only leave the input file and will discard the repacked file. out
does just the opposite. both
keeps both files (default). Note that buffer under/overflows and sync errors are counted as errors, whereas recompression errors (if using the -z
switch) are not.-i
--debug
[ in
| out
| huff
| all
]--debug in
will report frame statistics about the input file. --debug out
will report on how the file was processed and written. --debug huff
will print debug information about the recompression of frames if the -z
option is given. --debug all
does all three. It is recommended that you redirect the output to a file, as the information gets quite verbose.By specifying the -i
option, the program will print data about the input file then exit. No files will be written and the output (if given) will be ignored. Example printout:
*** "test/APS.mp3" INFO: MPEG1 layer 3 21687 frames 44100 Hz 38.281250 frames per second 566.517551 seconds 12514543 bytes in file (176.722405 kbps) 12514126 bytes in MP3 frames (176.716516 kbps) = current bitrate 93784923 bits of payload data (165.546368 kbps) 11732617 bytes of payload data (165.680544 kbps) 76013 bits wasted from partially-full bytes (0.134176 kbps) 12513349 bytes of MP3 data (176.705544 kbps) = minimum bitrate possible 777 bytes of padding (0.010972 kbps) 417 bytes outside MP3 frames (0.005889 kbps) 1 sync error Bitrate distribution: 32: 9,0 128: 3641,0 160: 7691,0 192: 6700,0 224: 2736,0 256: 785,0 320: 125,0 Largest frame uses 8478 bits = 1060 bytes = 324.548437 kbps Smallest bitrate for CBR is 256
*** "test/APS.mp3"
MPEG1 layer 3
21687 frames
44100 Hz
38.281250 frames per second
566.517551 seconds
12514543 bytes in file (176.722405 kbps)
-s
and -t
options.12514126 bytes in MP3 frames (176.716516 kbps) = current bitrate
93784923 bits of payload data (165.546368 kbps)
11732617 bytes of payload data (165.680544 kbps)
76013 bits wasted from partially-full bytes (0.134176 kbps)
12513349 bytes of MP3 data (176.705544 kbps) = minimum bitrate possible
777 bytes of padding (0.010972 kbps)
417 bytes outside MP3 frames (0.005889 kbps)
1 sync error
32: 9,0
128: 3641,0
160: 7691,0
192: 6700,0
224: 2736,0
256: 785,0
320: 125,0
Largest frame uses 8478 bits = 1060 bytes = 324.548437 kbps
Smallest bitrate for CBR is 256
-z
switch when the errors had no effect on anything.-z
which showed up mainly for high-bitrate iTunes encodes.-z
option for brute-force Huffman table searching.-i
mode, and prints sync/buffer errors if they occur in normal mode.-w
switch to throw out entire frames if only one granule has a buffer error. This mirrors what Foobar does upon encountering a broken frame.-u
switch.