Simple MPEG-1 layer-II audio encoder
see also :
mpeg2enc - lavplay - lav2yuv - lav2wav - yuvscaler
[-v num] [-b bitrate_kbps]
[-r output_sampling_rate_hz] [-R
rate,chans,bits] [-s ] [-m ] [-e
] [-V ] [-?]
add an example, a script, a trick and tips
for exe in mplayer mpeg2enc
mp2enc mplex yuvscaler ; do
if [ -z
"`which $exe`" ];
echo "ERROR: $exe must
be in your path $PATH!"
mp2enc -b $abr -r $asr -o $NAME.mpa <
elif [ $mp3 -ne 0 ]; then
echo "wait, encoding to
mp3 audio with lame..."
Mp2enc is a
simple MPEG-1 layer-I/II audio encoder. It is actually a
very mildly warmed over version of the MPEG Software
Simulation Group’s reference encoder. It accepts a WAV
file or stream on stdin and ouputs an a layer-I/II
elementary audio stream. It is included in the
mjpegtools(1) primarily for reasons of completeness
and because it is able to perform sampling rate
Those seeking a
faster (and probably higher quality) layer II encoder are
recommended to use toolame(1) which can be obtained
function letters controlling output stream structure
This sets the bit-rate of the output stream in kBit/sec. Typical
values for layer II might be 224kbps for good-quality audio
suitable for capturing Dolby pro-logic signals. A rate of 192kbps
or 128kbps is reasonable for low quality audio (e.g. mono TV
audio). Really high compression is, of course, better achieved
using MPEG-1 layer III ("MP3") audio encoding or AAC. A more
appropriate value for layer I might be 384kbps.
Sets the audio sampling rate of the reconstructed output signal
in Hz. Legal values are 32000, 44100 and 48000Hz. mp2enc will
automatically sample-rate convert the input signal if necessary.
Sets the audio layer. Legal values are 1 and 2. The default is
Force stereo output. A mono input signal is channel doubled
before encoding to make it stereo. This is useful for players
which simply can’t handle a non-stero signal.
Force mono output. A stereo input signal is down-mixed before
encoding. Useful if you’ve captured a mono signal in stereo
and your player can handle mono MPEG-1 Layer 2 audio.
Use CRC error protection.
Force VCD compatible output. The primary effect of this is to
make certain that the sampling rate is set to 44100 (-r 44100).
The VCD2.0 specifications permit mono audio at 64, 96 and 192
kbits/sec and stereo at 128, 192, 224, and 384 kbits/sec. Using
-V checks that the bitrate is valid for the number of
channels. The defaults (unless -m or -b are used) are stereo at
The name of the output file to generate. If ’-’ is
given as the pathname output is written to standard output.
general function letters
Specifies the name for the output file.
An integer format code (e.g. %d) in the name is replaced the
number of the file generated (see printf(3)).
Set verbosity level to num. 0 = warnings and errors only, 1 =
information as well, 2=really verbose. -? Display a
synopsis of the command syntax.
Indicate, that the input is raw PCM without header. You must
specify 3 numbers: rate is the samplerate in Hz, chans is the
number of channels (1 or 2) and bits is the number of bits per
sample. 8 bits are unsigned, 16 bits are signed in machine native
does not work for layer I.
mp2enc, lavrec, lavplay ,
lav2yuv , lav2wav ,
This man page
was written by Andrew Stevens.
If you have questions, remarks, problems or you just want to
contact the developers, the main mailing list for the
For more info, see our website at