mp2enc(1)
β¨ mp2enc β the manual page, but make it make sense β¨
okay bestie, sit down, grab a boba, because today we're learning about mp2enc, a lil audio encoder from the MJPEG tools fam. it's giving "vintage but functional", and honestly? we love her for it. π
π NAME π
mp2enc β a simple MPEG-1 layer-II audio encoder. that's it, that's the name, she's lowkey humble about it. β¨
πΈ SYNOPSIS πΈ
mp2enc [-v num] [-b bitrate_kbps] [-r output_sampling_rate_hz] [-R
rate,chans,bits] [-s ] [-m ] [-e ] [-V ] [-?] -o output_filename
that's the whole vibe check right there. one line, so many letters. π¦
π DESCRIPTION π
so mp2enc is a simple MPEG-1 layer-I/II audio encoder. and when we say "simple", we mean it β she's literally a very mildly warmed over version of the MPEG Software Simulation Group's reference encoder. like, the reference encoder's glow-up was a nap and a new hoodie, no cap. π
she takes a WAV file (or a stream on stdin) and outputs a layer-I/II elementary audio stream. she's included in mjpegtools(1) mainly for reasons of completeness, and also because she can do sampling rate conversion β which is genuinely her party trick, periodt. β¨
bestie heads up: if you want a faster (and probably higher quality) layer II encoder, the manual itself says go usetoolame(1)instead, which you can grab from:text http://www.planckenergy.comnot me telling you to cheat on her, but the docs said it first π
π GENERAL FUNCTION LETTERS π
π« -o output_filename
Specifies the name for the output file.
and here's the cute part: an integer format code (like %d) inside the name gets replaced with the number of the file generated β see printf(3) for how that whole thing works. π§
π« -v num
Set verbosity level to num. the scale is:
0β warnings and errors only (she's quiet, she's mysterious)1β information as well2β really verbose (she will not stop talking, and honestly? relatable)
π« -?
Display a synopsis of the command syntax. a little cheat sheet, a lil reminder, we love a self-aware icon. π
π« -R rate,chans,bits
Indicate that the input is raw PCM without header. this one's a three-number situation, you must specify all three:
rateβ the samplerate in Hzchansβ the number of channels, which is1or2bitsβ the number of bits per sample
and the tea on bits: 8 bits are unsigned, 16 bits are signed, and both are in machine native byte order. no cap, that detail matters. β
π¦ FUNCTION LETTERS CONTROLLING OUTPUT STREAM STRUCTURE π¦
π
-b bitrate
This sets the bit-rate of the output stream in kBit/sec.
typical values for layer II might be:
224kbpsβ good-quality audio, suitable for capturing Dolby pro-logic signals192kbpsor128kbpsβ reasonable for low quality audio (e.g. mono TV audio)
and fr fr, if you want really high compression, the manual says that's, of course, better achieved using MPEG-1 layer III ("MP3") audio encoding or AAC. a more appropriate value for layer I might be 384kbps. she contains multitudes. β¨
π
-r sampling_rate
Sets the audio sampling rate of the reconstructed output signal in Hz.
legal values are exactly: 32000, 44100 and 48000 Hz. and if the input doesn't match? mp2enc will automatically sample-rate convert the input signal if necessary. she's proactive like that. π
π
-l layer
Sets the audio layer. legal values are 1 and 2. the default is layer II. π
π
-s
Force stereo output. a mono input signal gets channel doubled before encoding, so it becomes stereo. this is useful for players which simply can't handle a non-stereo signal. (yes, those players exist. we don't judge them, we accommodate them. π«Ά)
π
-m
Force mono output. a stereo input signal gets 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. π the duality of audio.
π
-e
Use CRC error protection. that's it. tiny flag, big responsibility. π₯
π
-V
Force VCD compatible output. the primary effect of this is to make certain that the sampling rate is set to 44100 β which is to say, -r 44100. π
the VCD2.0 specifications permit:
- mono audio at
64,96and192kbits/sec - stereo at
128,192,224, and384kbits/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 224 kbits/sec. slay. β¨
π
-o outputpathname
The name of the output file to generate. and here's the spicy bit: if - is given as the pathname, output is written to standard output. yes bestie, dash means stdout. iykyk. π¦
π BUGS π
Mono output does not work for layer I.
that's it. that's the whole bug. she's honest about her flaws, which is main character energy ngl. π
π§ AUTHOR π§
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 MJPEG-tools is:
mjpeg-users@lists.sourceforge.net
for more info, see our website at:
http://mjpeg.sourceforge.net
π SEE ALSO π
and that's the whole page, bestie!! π«Ά this lil icon was brought to you by the MJPEG Tools Team, dated 2 June 2001. go forth and encode responsibly. πβ¨ππ¦πΈπ
π¦ where this page comes from
- arch rolling: mjpegtools 2.2.1-4 Β· GPL-2.0-or-later
- debian bookworm: mjpegtools 1:2.1.0+debian-7
- debian trixie: mjpegtools 1:2.1.0+debian-8.1+b1
- fedora 43: mjpegtools 2.2.1-11.fc43 Β· GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-or-later
- fedora 44: mjpegtools 2.2.1-12.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-or-later
- nixos 26.05: mjpegtools 2.2.1
- nixpkgs unstable: mjpegtools 2.2.1
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- ubuntu jammy: mjpegtools 1:2.1.0+debian-6build1
- ubuntu noble: mjpegtools 1:2.1.0+debian-8.1build1
- ubuntu questing: mjpegtools 1:2.1.0+debian-8.1build1
- ubuntu resolute: mjpegtools 1:2.2.1-3
- ubuntu stonking: mjpegtools 1:2.2.1-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms