-> Home

MPEG Audio Utility

Release: 0.28

→ description → usage → download → history → todo → contact

Description

This Utility analyzes, copies or modifies all frames of MPEG-1, MPEG-2 or MPEG-2.5 audio files compressed with Layer I, II or III.

Analysis
- general information, like length or ID3v1 tags
- detailed information about all frame headers (optional)
- summary information about the frame headers, like VBR or MS-stereo distribution
- frame consistency checks
Copy
You may copy an entire file or parts of it to a new file.
Modification
The gain (volume) may be modified. This is lossless. It is implemented by modifying all side info blocks or the scale factors respectively of the file. This restricts the step size to 1.5 dB for layer III files and 2 dB for layer I and II files.
Furthermore files may be stripped. This means that leading and trailing silence (empty frames) is removed.
You may also use your own cut points by time or frame.

Usage

installation

Copy the executable somewhere to your hard drive. You must have the gcc 3.3.5 runtime (gcc335.dll and libc063.dll) somewhere in your LIBPATH. Both can be found at Netlabs.
Create a program object for it and modify the settings to not to close the window on exit. If you like to modify the gain of the files by this way, you should enter [options] "%*" as parameter of the program. You will be asked for additional options every time you drop a file.
If you prefer command windows, place the executable somewhere in your PATH.

usage

Simply drop an MPEG file on the program object or enter frameanalyzer filename [outputfilename] [options].
If no output file is specified any modifying option will work in place.

command line options

/v
Print a verbose info of every (valid) frame.
/lnum
Modify gain by 1.5 · numdB (layer III files) or 2 · numdB (layer I & II files) respectively. Negative values will decrease the volume.
Remember that you can overdrive the file. However, usually not the MPEG stream is overdriven but the decoder engine will overdrive when the samples are quantized to 16 bit. So, fortunately this is reversible unless you left the domain of the gain fields, which is not very likely for layer III files as they have a dynamic range of >380dB.
In case of layer I and II files you have to be much more careful. You may run FrameAnalyzer without any changes first to check the used value range of the gain fields. num is added to these gain fields. The value must mot exceed the range [0..63] for layer I and II files.
/sthres
Strip leading and trailing empty frames.
This will remove silence and invalid frame data. Due to the bit reservoir of MPEG Layer III files, usually a few frames with silence will remain at the beginning. thres is number of different bytes per empty frame. It defaults to 10 if omitted. If thres is negative then the gain fields of the sideinfo blocks are ignored. In this case only the entropy of the frame is taken to identify silence. You need this for FhG encoded files, where the gain fields contain nonsense for empty frames.
This option also removes the futile wave header of some files, which confuses some applications. Use /s0 if you want to remove junk data only.
/z[num]
Make the first num frames silent.
This is helpful to remove clicks at the front of cutted layer III files because of missing data in bit reservoir. Reasonable values are between 1 and 3. The default is 2. This is implemented the same way as the /l option.
/fsframe /feframe
First frame to keep or last frame not to keep, respectively. The output file receives only the range [first frame, last frame).
This option will not work in place unless you use the /c option.
/tstime /tetime
Start and end time. Only frames in the range [start time, end time) is written to the output file. time must be one of the following formats: ss, ss.ff, mm:ss, mm:ss.ff, hh:mm:ss or hh:mm:ss.ff with ss = seconds, mm = minutes, hh = hours and ff = fractional seconds. None of the fields is restricted to two digits.
This option will not work in place unless you use the /c option.
/c
Enable cutting of files in place. To avoid accidental damage to the original files you must enable the /f... and /t... options explicitly if you have not specified an output file.
/n
Do fast processing. This disables the processing of the frame contents to reduce CPU usage. The options /l, /z and /s cannot be used together with /n since they depend on the frame content.

When you use more than one cut option (/s..., /f... or /t...) at the same, the most "narrow" options count. Only the range [max(start frame, start time, first non-empty frame), min(end frame, end time, first non-empty frame)) is kept.


Download

This program is distributed under the terms of the GNU GENERAL PUBLIC LICENSE.
The allocation table logic for Layer II files is taken from mpg123 which is distributed under LGPL terms.

ZIP file with source, OS/2 binary and this guide: Version 0.28

The OS/2 binary requires the gcc runtime libc063.dll to execute (LGPL).


History

Version 0.28 Jun. 19, 2005

Version 0.27 Jan. 12, 2005

Version 0.26 Apr. 6, 2004

Version 0.25 Dec 3, 2003

Version 0.24 Version 0.23 Version 0.22 Version 0.21 Version 0.2

ToDo, known issues

Create correct CRC fields
Currently the (optional) CRC fields of the MPEG frames are neither updated nor checked.
Fix the MP3 bit reservoir after cutting
Layer III files spreads the main data over frames in the past. This causes dead references when a file is cut at a frame boundary. This should be fixed when splitting.
The bit reservoir checking seems to trigger on each frame of some MP3 files.
So far, I don't know whether this is a bug or the files are really broken due to a bug in an MP3 encoder.

Contact

Suggestions, help, complaints (but not too much:-): Mail address: mueller (at) maazl (dot) de

Original homepage: http://www.maazl.de/project/mp3/mp3frame.html