annotate src/com/aurellem/capture/examples/HelloVideoRecording.java @ 62:f5e52169f056

updated to work with new jme changes
author Robert McIntyre <rlm@mit.edu>
date Wed, 14 Dec 2011 17:43:52 -0700
parents afc437f637bd
children
rev   line source
rlm@39 1 package com.aurellem.capture.examples;
rlm@39 2
rlm@39 3 import java.io.File;
rlm@39 4 import java.io.IOException;
rlm@39 5
rlm@39 6 import jme3test.helloworld.HelloLoop;
rlm@39 7
rlm@47 8 import com.aurellem.capture.Capture;
rlm@39 9 import com.aurellem.capture.IsoTimer;
rlm@47 10 import com.jme3.app.Application;
rlm@39 11
rlm@56 12 /** Recording Video from your Application is simple. If all you want
rlm@56 13 * to do is record Video, then follow the following steps.
rlm@50 14 *
rlm@50 15 * 1.) Set the Application's timer to an IsoTimer. The framerate of
rlm@50 16 * the IsoTimer will determine the framerate of the resulting video.
rlm@50 17 *
rlm@50 18 *
rlm@50 19 *
rlm@50 20 * 2.) Call Capture.captureVideo(yourApplication, target-file) before
rlm@50 21 * calling yourApplication.start()
rlm@50 22 *
rlm@50 23 * That's it! If you have any comments/problems, please PM me on the
rlm@50 24 * jMonkeyEngine forms. My username is bortreb.
rlm@50 25 *
rlm@50 26 * @author Robert McIntyre
rlm@50 27 */
rlm@45 28 public class HelloVideoRecording {
rlm@39 29
rlm@56 30 public static void main(String[] ignore) throws IOException {
rlm@56 31 Application app = new HelloLoop();
rlm@56 32 File video = File.createTempFile("JME-simple-video", ".avi");
rlm@56 33 app.setTimer(new IsoTimer(60));
rlm@56 34 Capture.captureVideo(app, video);
rlm@56 35 app.start();
rlm@56 36 System.out.println(video.getCanonicalPath());
rlm@56 37 }
rlm@39 38 }