r.out.mpeg(1grass)

โœจ NAME โœจ

ok so welcome to r.out.mpeg(1grass) โ€” your girl is here to turn a whole series of raster maps into one MPEG movie, no cap ๐Ÿ’–

It Converts raster map series to MPEG movie.


๐Ÿท๏ธ KEYWORDS ๐Ÿท๏ธ

raster, export, output, animation โ€” that's the vibe check ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

r.out.mpeg
r.out.mpeg --help
r.out.mpeg [-c] view1=name[,name,...]  [view2=name[,name,...]]
[view3=name[,name,...]]   [view4=name[,name,...]]  output=name
[quality=integer]   [--overwrite]  [--help]  [--verbose]  [--quiet]
[--ui]

๐ŸŽ€ Flags:

  • -c โ€” converts "on the fly", so it uses less disk space. Heads up bestie: this one Requires r.out.ppm with the stdout option.
  • --overwrite โ€” lets output files overwrite files that already exist (yes, permission to be messy ๐Ÿ™ˆ).
  • --help โ€” prints the usage summary, aka the cheat sheet.
  • --verbose โ€” verbose module output, it WILL overshare.
  • --quiet โ€” quiet module output, the introvert mode ๐Ÿคซ.
  • --ui โ€” forces launching the GUI dialog.

๐Ÿงš Parameters:

  • view1=name[,name,...] โ€” [required]. Name of input raster map(s) for view no.1.
  • view2=name[,name,...] โ€” Name of input raster map(s) for view no.2.
  • view3=name[,name,...] โ€” Name of input raster map(s) for view no.3.
  • view4=name[,name,...] โ€” Name of input raster map(s) for view no.4.
  • output=name โ€” [required]. Name for output file.
  • quality=integer โ€” Quality factor (1 = highest quality, lowest compression). Options: 1-5. Default: 3.

๐Ÿ’… DESCRIPTION ๐Ÿ’…

ok so r.out.mpeg is the tool that combines a whole series of GRASS raster maps into ONE single MPEG-1 (Motion Pictures Experts Group) format file. iconic behavior honestly ๐Ÿ‘‘

But listen โ€” MPEG-1 is a "lossy" video compression format. That means the quality of every resulting frame of the animation will be much diminished from the original raster image. So it's giving glow-down, not glow-up ๐Ÿ˜ญ. The resulting output file can then be viewed with your favorite mpeg-format viewing program. And girl, if you want better, MPEG-2 and MPEG-4 provide much better quality animations.

You can define up to four "views", aka sub-windows, to animate simultaneously. Like, example: View 1 could be rainfall, View 2 flooded areas, View 3 damage to bridges or levees, View 4 other economic damage โ€” all animated as a time series. So extra โœจ. A black border 2 pixels wide gets drawn around each view. There's an arbitrary limit of 400 files per view (that's 400 animation frames). Temporary files are created during the conversion process, so lacking adequate tmp space could ALSO limit the number of frames you're able to convert. Budget your disk, bestie ๐Ÿ’€

The environment variable GMPEG_SIZE is checked for a value to use as the dimension, in pixels, of the longest dimension of the animation image. If GMPEG_SIZE is not set, the animation size defaults to the rows & columns in the current GRASS region โ€” scaling if necessary to a default minimum size of 200 and maximum of 500. These size defaults get overridden when you use the -c flag (see below ๐Ÿ‘‡). The resolution of the current GRASS region is maintained, independent of image size. Playback programs have to decode the compressed data "on-the-fly", which is why smaller dimensioned animations will give you higher frame rates and smoother animations. Math doing its thing ๐Ÿงฎ

UNIX-style wild cards may be used with the command line version in place of a raster map name โ€” but wild cards must be quoted. Learn from my mistakes ๐Ÿ™ˆ

A quality value of quality=1 will yield higher quality images, but with less compression (aka a larger MPEG file size). Compression ratios will vary depending on the number of frames in the animation, but an MPEG produced using quality=5 will usually be about 60% the size of the MPEG produced using quality=1.


๐ŸŒˆ EXAMPLES ๐ŸŒˆ

r.out.mpeg view1="rain[1-9]","rain1[0-2]" view2="temp*"

If the number of files differs for each view, the view with the fewest files will determine the number of frames in the animation. The smallest one sets the pace, periodt.

With the -c flag the module converts "on the fly", and uses less disk space by using r.out.ppm with the stdout option to convert frames as needed instead of converting all frames to ppm before encoding. Only use when encoding a single view. Use of this option also overrides any size defaults, using the CURRENTLY DEFINED GRASS REGION for the output size. So be careful to set region to a reasonable size prior to encoding โ€” that region is the main character and whatever it says goes ๐Ÿ‘‘


๐Ÿ’€ KNOWN ISSUES ๐Ÿ’€

  • MPEG images must be 16-pixel aligned for successful compression, so if the rows & columns of the calculated image size (scaled, with borders added) are not evenly divisible by 16, a few rows/columns will be cut off the bottom & right sides of the image. RIP to those pixels fr.
  • The MPEG format is optimized to recognize image MOTION, so abrupt changes from one frame to another will cause a "noisy" encoding. Smooth transitions only, please โœจ

๐Ÿ“ NOTES ๐Ÿ“

This program requires the program mpeg_encode (aka ppmtompeg):

MPEG-1 Video Software Encoder
(Version 1.3; March 14, 1994)

Lawrence A. Rowe, Kevin Gong, Ketan Patel, and Dan Wallach Computer
Science Division-EECS, Univ. of Calif. at Berkeley

Available from Berkeley: http://biowiki.org/BerkeleyMpegEncoder (Wayback machine), or as part of the netpbm package (ppmtompeg): https://netpbm.sourceforge.net

Use of the -c flag requires the r.out.ppm GRASS module with the stdout option.


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

r.out.ppm


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Bill Brown, U.S. Army Construction Engineering Research Laboratories


๐Ÿ”ฅ SOURCE CODE ๐Ÿ”ฅ

Available at: r.out.mpeg source code (history)

Latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

ยฉ 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


ok that's the whole page bestie, you made it to the end ๐Ÿซถ this was r.out.mpeg(1grass) from the GRASS 8.5.0 manual, last touched Friday Apr 17 01:04:26 2026 โ€” go make a movie, you've got this ๐Ÿ’œ๐ŸŽฌ๐ŸŒธ

๐Ÿ“ฆ where this page comes from