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 use toolame(1) instead, which you can grab from: text http://www.planckenergy.com not 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 well
  • 2 β€” 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 Hz
  • chans β€” the number of channels, which is 1 or 2
  • bits β€” 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 signals
  • 192kbps or 128kbps β€” 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, 96 and 192 kbits/sec
  • 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 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. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’