Movie Recorder

Movie recording script. Plays back a script file with camera positions and records each frame to sequentially numbered bitmap files on disk.


 * Download plugin for World Wind 1.4


 * Download plugin v1.3 Not compatible with World Wind 1.4

How to use the plugin
The movie recorder plugin is deceptively easy to use. You create a simple text file with a script that tells the camera when and where to move, then play that script back while the plugin saves a number of screenshots. These screenshots (or frames) can then be combined into a movie.

The script
A script used by this plugin is a text file, not to be confused with the xml scripts that can also be handled by World Wind. There is no way to record a script at the moment; you have to write it yourself. Luckily, this is a simple process.

An example script file is shown below: 0;worldwind://goto/world=Earth&lat=41.68695&lon=-87.70575&alt=374070 20;worldwind://goto/world=Earth&lat=41.68697&lon=-87.70575&alt=6889382 70;worldwind://goto/world=Earth&lat=51.44871&lon=-0.01974&alt=6889382 90;worldwind://goto/world=Earth&lat=51.44871&lon=-0.01974&alt=374070 110;worldwind://goto/world=Earth&lat=51.44871&lon=-0.01974&alt=374070

Each line consists of a time and a World Wind url, seperated by a semicolon. The time is in units of 0.1 seconds; 1 s = 10, 2 s = 20, 1 min = 600, etc. The url is what World Wind uses to cut & paste a location for the camera. You can write this url yourself if you want, or you can use the "Edit -> Copy Coordinates" menu item in World Wind to copy the url for the current camera view. Note that the urls above just contain the world, latitude, longitude, and altitude of the camera. A World Wind url can also contain tilt or rotation of the camera as well as the imagery layer. For this example we are just changing latitude, longitude, and altitude.

The example script contains 5 lines:
 * 1) At time zero the camera will be at the url given (looking at Chicago).
 * 2) At time 20 (2 seconds later), the camera will be at the same latitude and longitude, but at a higher altitude.  The plugin will move the camera smoothly from one line in the script to the next; in this case it just zooms out.
 * 3) At time 70 (5 seconds after zooming out) the camera is at the same altitude but a different latitude and longitude (looking at London).  The plugin will smoothly move the camera from Chicago to London without changing altitude.
 * 4) At time 90 (2 seconds after arriving at London) the latitude and longitude are the same but the altitude has changed, thus the camera will zoom in.  Note that the altitude after zooming is the same as the original altitude at Chicago was.  The altitudes in this url and the previous one were set by hand to match the ones in the first two lines, just to be consistent.
 * 5) At time 110 (2 seconds after zooming in) the camera is in exactly the same location.  After the script is finished, the camera will snap back to where it was before the script was played, so this 2 seconds at the end provides an end to the animation that isn't so sudden.

Playing the script
To play this script, cut and paste it into a text file and save the file somewhere with a .sc extension. Start World Wind, then click the "Plug-ins -> Movie Recorder" menu item. The dialog box shown above will appear. It has the following options:


 * The script file itself - choose the script wherever you saved it.
 * Pre-roll time (in ms) - this is how long the plugin will wait after the camera moves and before each screenshot is taken.  As the script is playing, World Wind will be downloading tiles or loading them from the cache just like when you browse around by hand, so using a pre-roll time will give it time to get all of the tiles and terrain in the view loaded before the screenshot is taken.  This will probably need to be at least 500 ms, but may need to be longer depending on how fast your PC is at loading imagery.  If you can see incomplete imagery in the final screenshot then you need to use a larger pre-roll time, as well as make sure that all of the necessary tiles are downloaded beforehand.
 * Frame range - which frames in the animation will actually be saved. Leave this alone for this example; it will automatically stop saving frames at the end of the script.
 * Frame dimensions - this is how big the images in the final movie will be. It achieves this size by resizing the World Wind window before recording the screenshots.  640x480 is usually good for a movie, you can use 480x320 to make the final movie file size smaller.
 * Output files - this is how the screenshots will be named. The number range in the curly braces will be incremented for each frame.  Leave this at the default for this example.

To play the script, click the "Play" button. This will play back the script without recording any screenshots, so it can be used to tweak your script before the final recording. Clicking "Stop" will halt any the playback or recording. Try changing the urls in the example file or adding extra lines to the script and see what the results look like. Try pasting some urls with the camera tilted or rotated and see what that looks like. Keep in mind that if you insert a line in the middle of the script then you need to update the times on all of the lines following it.

NOTE: Turn off Motion Momentum and Planet Inertia in the "View" menu before playing or recording. The playback code will make the movement smooth on its own.

Recording the script
To record the movie, click the "Record" button. This will step through the animation one frame at a time, saving a screenshot for each from in the main World Wind directory (probably C:\Program Files\NASA\World Wind 1.3\). This will be slower than the animation as played back using the "Play" button because it waits for the length of the pre-roll time before taking each screenshot.

See the results of the recording in the main World Wind directory. There should be a large number of images sequentially named "movie_####.png".

Turning the frames into a movie
The app I use for this is VirtualDubMod. It is free and can be used to do simple video editing tasks. Download and install it.

Start VirtualDubMod, then go to "File -> Open Video File...". For the file type choose "Image sequence", then navigate to your World Wind directory where all of the screenshot/frames were saved. Choose the "movie_0001.png" file and click "Open". VirtualDubMod will automatically find the rest of the screenshots and then assemble them into a movie in the correct order. Go to "File -> Save as..." to save the movie as an avi file.

You can follow similiar steps with your own video editing app if you have one.

VirtualDubMod no longer works!

Tips

 * Delete the png frames in the World Wind directory after you save your avi to save disk space.
 * Move through your script's path by hand slowly to make sure all of the imagery and terrain you need is downloaded already. While you are recording then the tiles will just need to be loaded from cache, which should be quicker than downloading them.
 * If you are accustomed to working with frame rates consider "100" which represents 10 seconds in the explanation above to be the number of frames. Then if you want an animation that plays at a frame rate of 30 frames per second (approximately the NTSC frame rate, the TV standard in the U.S.)and you want the animation to have a duration of 10 seconds make the final line of the script "300;worldwind: ..... ". Your result will be 300 frames an animation of 10 seconds for NTSC. For the European standard "PAL" the frame rate is 25 fps, make the final line for a 10 second animation "250;worldwind: ....".

If I made any mistakes in this tutorial, feel free to fix them.