FANDOM


Making movies with xnbody Edit

written by A. Ernst (aernst@ari.uni-heidelberg.de, August 10, 2005)

  1. Download the tool "mpeg_encode" (the download area is here) from the UC Berkeley and install it on your machine. Some minor patches in the source code may be necessary!
  2. Run nbody6 and xnbody. Wait until the online visualisation starts. Select Tools->Animation from the menu. In the Output window, choose a directory, the prefix "try" and the file format "jpeg". In the Record window, choose a frequency (for instance, "30000") and push the start button. Now the program will start producing jpeg files (one every 30 seconds) starting with "try0000.JPEG". Wait until there are enough jpeg files for a movie.
  3. Copy the binary file "mpeg_encode" into the directory with your jpeg files. This tool requires the pictures to be in .ppm format.
  4. Write the following shell script named "mkppm" consisting of one line:
    for i in try*.JPEG; do new=`basename $i .JPEG`.ppm; echo $new; convert $i $new; done

    This will convert all your JPEG files to .ppm files. You can also use djpeg instead of convert, which is included with mpeg_encode:

    for i in try*.JPEG; do new=`basename $i .JPEG`.ppm; echo $new; djpeg $i > $new; done
  5. Create a parameter file for mpeg_encode (named "parfile", for instance), which looks like this:
    # mpeg_encode parameter file
    
    PATTERN		I
    OUTPUT		test.mpg
    GOP_SIZE	30
    SLICES_PER_FRAME	1
    REFERENCE_FRAME ORIGINAL
    BASE_FILE_FORMAT	PPM
    YUV_SIZE	352x240
    INPUT_CONVERT	*
    INPUT_DIR	.
    INPUT
    try*.ppm	[0000-0100]
    END_INPUT
    ERROR		MAD
    PIXEL		FULL
    RANGE		8
    PSEARCH_ALG	EXHAUSTIVE
    BSEARCH_ALG	SIMPLE
    IQSCALE		31
    PQSCALE		10
    BQSCALE		25

    Modify this file accordingly: In the line starting with "try*.ppm" insert the start and end number of your image files.

  6. Type
    mpeg_encode parfile
    in the command line and press Enter.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.