Movies

From GRASS-Wiki
Jump to navigation Jump to search

Q: If anyone has tips on constructing high-quality MPEG-4 movies (animations) from a series of still frames, I'd be interested in hearing them.

Maris wrote:

Encode all .png files in directory to out.avi with 15 frames per second:

mencoder "mf:///path/to/files/*.png" -mf fps=15 -o out.avi # put -ovc here, see next lines

## for DivX - libavcodec MPEG 4 (DivX5), use:
-ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1800 -ffourcc MP4S
## for XviD, use:
-ovc xvid -xvidencopts bitrate=1024
## for DivX4, use:
-ovc divx4 -divx4opts q=5

Uses mplayer's encoder. Choose one of encoding formats and append to end of "mencoder" line. Unfortunately only way to know quality settings is by encoding, watching result and reendocing with different params.

Notice - by default encoding with lavc will set video fourcc to FMP4, that can be decoded with ffdshow. Option -ffourcc MP4S will change it to MPS4 ("official" MS fourcc for mpeg4) and video will be playable on Windows by standart MS mpeg4 decoder. It may lead to side effects, if MS mpeg4 decoder is buggy. More info: http://www.itdp.de/mplayer-users/2005-03/msg00069.html




Q: How to generate an animated GIF, FLI, or MNG?

A: for animations of 300 frames or less, animated GIF, FLI, or MNG formats are smaller files and better quality (ie frames stored as PNG not JPEG). Create with gifsicle, ppm2fli, or for MNG use ImageMagick's 'convert'. With more than 300 frames the players usually have memory issues. Animated GIFs are playable in any web browser of course and also in OpenOffice.




Q: How to create dynamic surface movies in NVIZ

A: See slides from the FOSS4G 2006 workshop: http://skagit.meas.ncsu.edu/~helena/grasswork/foss4g/FOSS4G06WKSVisual4anim.odp

See also the example at the bottom of the NVIZ keyframe animator panel help page.



Q: How to animate a time series of raster maps?

A: Use



Q: How to animate a series of maps, including decorations?

A: Use the xmon drivers (d.mon) to render the displays to a window via a shell script loop, then switch from the x0 to PNGdriver to save as a series of PNG or PPM images. Use a method answered in a FAQ above to combine those into a single animation.

Example: [incomplete]

for IMG in `seq 0 100` ; do
   d.rast
   d.vect
   d.graph << EOF
      move $IMG 50
      symbol basic/circle
   EOF
   echo "Title" | d.text
done