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, or2. default is 2-oβ output file. defaults tofirstInputFileName.mpg-bβ video bitrate in kbps. only used when-ois"mpeg1"or"mpeg2"-aβ audio bitrate in kbps. only used when-ois not"vcd*"-qβ quality formpeg2enc. only used when-ois"mpeg1"or"mpeg2"-dβ dimensionsXxY. only used when-ois"mpeg1"or"mpeg2", defaults to same as input
π MODES π
the whole menu, she ate:
vcdβ standard VCD (352x240or352x288)vcd_mediumβ1550kbpsvideo VCD (352x240or352x288)vcd_highβ1800kbpsvideo VCD (352x240or352x288)svcdβ standard SVCD (480x480or480x576)svcd_highβ3000kbps(max) vbr @qual=5 (480x480or480x576)mpeg1β honor-a-b-q-dflags, default resolution same as inputmpeg2β honor-a-b-q-dflags, 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 theLAV2MPEG_OPTIONSvariable 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 usingnice -n commandYUVSCALERβ modify which command is called foryuvscalerLAV2WAVβ modify which command is called forlav2wavMPLEXβ modify which command is called formplexYUVDENOISEβ modify which command is called foryuvdenoiseMPEG2ENCβ modify which command is called formpeg2encAUDIOENCβ audioenc is similar to those above, however, if it is set to'mp2enc'it will usemp2encrather thantoolame, and set flags appropriately.NOISYLOGFILEβ set the file used for noisy logging (-N). defaults tooutputfile.logQUIETLOGβ set the file used for quiet logging. defaults tolav2mpeg.log; if set to""it will log only to screenLOGDATEβ defaults to1, set to0to not have the date logged in log or output (seeman datefor more info)LOGDATESTRβ will pass this on to'date'to describe what time format to use. Only used ifLOGDATEis not0LOGCOMMANDSβ if set to non-zero, will log to the quite log the commands used. Commands are always logged toNOISYLOGFILEif usedLOGONLYβ if set to non-zero, will only log the commands it would use but not actually run any commandsLAV2MPEGRCβ thelav2mpegrcfile. Only beneficial if set from environment variable.VCD_MEDIUM_BRβ video bitrate formode=vcd_mediumVCD_HIGH_BRβ video bitrate formode=vcd_highSVCD_HIGH_BRβ video bitrate formode=svcd_highSVCD_HIGH_QUALβ quality used (-q 0-30tompeg2enc) forSVCD_HIGHSVCD_HIGH_BUFFSIZEβ buffsize (-Vtompeg2enc) used forsvcd_high, defaults to100EXTRA_LAV2YUVβ set extra command line arguments tolav2yuv, which will be added on the endEXTRA_YUVSCALERβ set extra command line arguments toyuvscaler, which will be added on the endEXTRA_MPEG2ENCβ set extra command line arguments tompeg2enc, which will be added on the endEXTRA_LAV2WAVβ set extra command line arguments tolav2wav, which will be added on the endEXTRA_AUDIOENCβ set extra command line arguments tomp2encortoolame(depending onAUDIOENC), which will be added on the endEXTRA_MPLEXβ set extra command line arguments tomplex, which will be added on the endEXTRA_YUVDENOISEβ set extra command line arguments toyuvdenoise, 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 πβ¨π¦
π¦ 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