lav2mpeg(1)

πŸ’– lav2mpeg β€” the MJPEG tools manual, but make it a group chat πŸ’–

okay so bestie, this is lav2mpeg(1) from the MJPEG tools manual and it is genuinely one of my faves, no cap. sit down, grab a strawberry πŸ“, and let me tell you everything.


✨ NAME ✨

lav2mpeg β€” converting lav files to mpeg, but the easy way πŸ’…


🌸 SYNOPSIS 🌸

lav2mpeg [ options ] lavfile1 [lavfile2 ... lavfileN]

πŸ¦‹ DESCRIPTION πŸ¦‹

so lav2mpeg is a shell script whose entire job is to make the mjpeg utilities not be a whole thing, okay? it gives you a convenient little path to convert from MJPEG files into the popular MPEG file formats. she supports output in VCD, medium and high rate VCD, SVCD, high rate SVCD, and generic mpeg1 and mpeg2. the range?? unmatched.

and the input files? literally any combination of AVI (.avi), Quicktime (.qt) or editlist files, as long as they're all lavtools-readable β€” think MJPEG-encoded AVI/Quicktime or DV type 2 AVI. mix and match, she doesn't care πŸ’β€β™€οΈ


πŸ‘‘ OPTIONS πŸ‘‘

every single one, bestie, we're not skipping a thing:

  • -s/S β€” turn stereo off/on. default is auto
  • -k/K β€” turn keeping of raw files off/on. default is off
  • -f/F β€” turn use of fifos off/on. default is off
  • -l/L β€” turn logging of the entire process off/on. default is off
  • -n/N β€” turn "noisy logging" off/on. default is off
  • -y/Y β€” turn use of yuvdenoise off/on. default is off
  • -m β€” one of MODES (see below πŸ‘‡). default is vcd
  • -e β€” encoding quality: 0, 1, or 2. default is 2
  • -o β€” output file. defaults to firstInputFileName.mpg
  • -b β€” video bitrate in kbps. only used when -o is "mpeg1" or "mpeg2"
  • -a β€” audio bitrate in kbps. only used when -o is not "vcd*"
  • -q β€” quality for mpeg2enc. only used when -o is "mpeg1" or "mpeg2"
  • -d β€” dimensions XxY. only used when -o is "mpeg1" or "mpeg2", defaults to same as input

🌈 MODES 🌈

the whole menu, she ate:

  • vcd β€” standard VCD (352x240 or 352x288)
  • vcd_medium β€” 1550kbps video VCD (352x240 or 352x288)
  • vcd_high β€” 1800kbps video VCD (352x240 or 352x288)
  • svcd β€” standard SVCD (480x480 or 480x576)
  • svcd_high β€” 3000kbps(max) vbr @qual=5 (480x480 or 480x576)
  • mpeg1 β€” honor -a -b -q -d flags, default resolution same as input
  • mpeg2 β€” honor -a -b -q -d flags, default resolution same as input

πŸŽ€ FILES πŸŽ€

  • ~/.lav2mpegrc β€” your user configuration file, bestie. it's bash sourceable, and it can modify any of the environment variables mentioned down in ENVIRONMENT, or it can set the LAV2MPEG_OPTIONS variable to add default options. it's giving customization πŸ’…

πŸ’œ ENVIRONMENT πŸ’œ

the way there are SO many of these, and every single one matters:

  • NICEVAL β€” the nice value of each command, set using nice -n command
  • YUVSCALER β€” modify which command is called for yuvscaler
  • LAV2WAV β€” modify which command is called for lav2wav
  • MPLEX β€” modify which command is called for mplex
  • YUVDENOISE β€” modify which command is called for yuvdenoise
  • MPEG2ENC β€” modify which command is called for mpeg2enc
  • AUDIOENC β€” audioenc is similar to those above, however, if it is set to 'mp2enc' it will use mp2enc rather than toolame, and set flags appropriately.
  • NOISYLOGFILE β€” set the file used for noisy logging (-N). defaults to outputfile.log
  • QUIETLOG β€” set the file used for quiet logging. defaults to lav2mpeg.log; if set to "" it will log only to screen
  • LOGDATE β€” defaults to 1, set to 0 to not have the date logged in log or output (see man date for more info)
  • LOGDATESTR β€” will pass this on to 'date' to describe what time format to use. Only used if LOGDATE is not 0
  • LOGCOMMANDS β€” if set to non-zero, will log to the quite log the commands used. Commands are always logged to NOISYLOGFILE if used
  • LOGONLY β€” if set to non-zero, will only log the commands it would use but not actually run any commands
  • LAV2MPEGRC β€” the lav2mpegrc file. Only beneficial if set from environment variable.
  • VCD_MEDIUM_BR β€” video bitrate for mode=vcd_medium
  • VCD_HIGH_BR β€” video bitrate for mode=vcd_high
  • SVCD_HIGH_BR β€” video bitrate for mode=svcd_high
  • SVCD_HIGH_QUAL β€” quality used (-q 0-30 to mpeg2enc) for SVCD_HIGH
  • SVCD_HIGH_BUFFSIZE β€” buffsize (-V to mpeg2enc) used for svcd_high, defaults to 100
  • EXTRA_LAV2YUV β€” set extra command line arguments to lav2yuv, which will be added on the end
  • EXTRA_YUVSCALER β€” set extra command line arguments to yuvscaler, which will be added on the end
  • EXTRA_MPEG2ENC β€” set extra command line arguments to mpeg2enc, which will be added on the end
  • EXTRA_LAV2WAV β€” set extra command line arguments to lav2wav, which will be added on the end
  • EXTRA_AUDIOENC β€” set extra command line arguments to mp2enc or toolame (depending on AUDIOENC), which will be added on the end
  • EXTRA_MPLEX β€” set extra command line arguments to mplex, which will be added on the end
  • EXTRA_YUVDENOISE β€” set extra command line arguments to yuvdenoise, which will be added on the end

πŸ™ˆ DIAGNOSTICS πŸ™ˆ

wanna just peek at what lav2mpeg would have called without actually doing it? run this, bestie:

LOGONLY=1 lav2mpeg ...

πŸ’€ BUGS πŸ’€

Possibly. 😭 Please let the author know. (not me being honest about it, but periodt, transparency is iconic)


🫢 AUTHOR 🫢

Scott Moser <smoser at brickies dot net>


🌟 EXAMPLES 🌟

create a VCD compliant mpeg regardless of input named file.mpg

lav2mpeg file.avi

create a SVCD high rate mpeg from input named out.mpg

lav2mpeg -o out.mpg -m svcd_high file.avi

use lav2yuv.new instead of lav2yuv, and add the -M MMX flag to yuvscaler:

LAV2YUV="lav2yuv.new" EXTRA_YUVSCALER="-M MMX" lav2mpeg file.avi

also!! Please read other examples included in documentation for .lav2mpegrc usage πŸ’–


lowkey reminder that this whole thing was brought to you by the MJPEG Tools Team, and this page is dated JANUARY 2002. so iconic of them, honestly. mwah, bye bestie πŸ’‹βœ¨πŸ¦‹