r.out.mpeg(1)

🎬 r.out.mpeg β€” bestie, we're making MOVIES πŸ’–

okay so real talk: this is the r.out.mpeg manual page from the GRASS GIS User's Manual, and it's literally the glow-up machine that turns your lil stack of raster maps into an actual MPEG-1 animation. cinema. 🍿✨


✨ NAME ✨

r.out.mpeg β€” converts raster map series to MPEG movie. that's it, that's the whole job, and she does it fabulously πŸ’…


🏷️ KEYWORDS 🏷️

raster, export, output, animation 🌈


πŸ“œ 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 β€” convert on the fly, uses less disk space. requires r.out.ppm with the stdout option πŸ¦‹
  • --overwrite β€” allow output files to overwrite existing files (be brave, or be careful, your call bestie) πŸ’€
  • --help β€” print usage summary
  • --verbose β€” verbose module output (she tells you everything πŸ‘€)
  • --quiet β€” quiet module output (she tells you nothing 🀫)
  • --ui β€” force launching 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 πŸ’–

so r.out.mpeg is the tool for combining a series of GRASS raster maps into a single MPEG-1 (Motion Pictures Experts Group) format file. and here's the tea: MPEG-1 is a "lossy" video compression format, so the quality of each resulting frame of the animation will be much diminished from the original raster image 😭. the resulting output file may then be viewed using your favorite mpeg-format viewing program. also, heads up β€” MPEG-2 and MPEG-4 provide much better quality animations. just saying. πŸ‘‘

you can define up to four "views", or sub-windows, to animate simultaneously. e.g., 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. iconic multitasking fr fr. a black border 2 pixels wide is drawn around each view. there is an arbitrary limit of 400 files per view (400 animation frames). temporary files are created in the conversion process, so lack of adequate tmp space could also limit the number of frames you are able to convert β€” watch 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 are overridden when using 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", therefore smaller dimensioned animations will provide higher frame rates and smoother animations 🌸

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. no cap.

a quality value of quality=1 will yield higher quality images, but with less compression (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. math is math πŸ’…


🌈 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 shortest queen sets the pace, that's just how it is πŸ™ˆ

with the -c flag the module converts "on the fly", uses less disk space by using r.out.ppm with 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 πŸ”₯

bestie please actually set your region first. she said CURRENTLY DEFINED. she meant it. 😭

πŸ’€ 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 πŸͺ¦

the MPEG format is optimized to recognize image MOTION, so abrupt changes from one frame to another will cause a "noisy" encoding. drama between frames = drama on screen ✨


πŸ“ 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. don't forget her, she's part of the plan πŸ’œ


πŸ‘€ 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)

accessed: Saturday Jan 17 05:40:52 2026

main index | Raster index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


and that's the whole page bestie πŸŽ€ that was GRASS 8.4.2, manual page r.out.mpeg(1) β€” go make something beautiful, and remember: quote your wildcards, check your tmp space, and keep your rows & columns divisible by 16. periodt. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from