annotate src/com/aurellem/capture/examples/HelloVideoRecording.java @ 51:6a1b28f060e6

interface documentation
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Dec 2011 13:42:30 -0600
parents 8a091a5f48fa
children afc437f637bd
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@50 12 /** Recording Video from your Application is simple. If all you
rlm@50 13 * want 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@47 30 public static void main(String[] ignore) throws IOException {
rlm@47 31 Application app = new HelloLoop();
rlm@47 32 File video = File.createTempFile("JME-simple-video", ".avi");
rlm@47 33 app.setTimer(new IsoTimer(60));
rlm@47 34 Capture.captureVideo(app, video);
rlm@47 35 app.start();
rlm@47 36 System.out.println(video.getCanonicalPath());
rlm@47 37 }
rlm@39 38 }