rlm@39: package com.aurellem.capture.examples; rlm@39: rlm@39: import java.io.File; rlm@39: import java.io.IOException; rlm@39: rlm@39: import jme3test.helloworld.HelloLoop; rlm@39: rlm@47: import com.aurellem.capture.Capture; rlm@39: import com.aurellem.capture.IsoTimer; rlm@47: import com.jme3.app.Application; rlm@39: rlm@50: /** Recording Video from your Application is simple. If all you rlm@50: * want to do is record Video, then follow the following steps. rlm@50: * rlm@50: * 1.) Set the Application's timer to an IsoTimer. The framerate of rlm@50: * the IsoTimer will determine the framerate of the resulting video. rlm@50: * rlm@50: * rlm@50: * rlm@50: * 2.) Call Capture.captureVideo(yourApplication, target-file) before rlm@50: * calling yourApplication.start() rlm@50: * rlm@50: * That's it! If you have any comments/problems, please PM me on the rlm@50: * jMonkeyEngine forms. My username is bortreb. rlm@50: * rlm@50: * @author Robert McIntyre rlm@50: */ rlm@45: public class HelloVideoRecording { rlm@39: rlm@47: public static void main(String[] ignore) throws IOException { rlm@47: Application app = new HelloLoop(); rlm@47: File video = File.createTempFile("JME-simple-video", ".avi"); rlm@47: app.setTimer(new IsoTimer(60)); rlm@47: Capture.captureVideo(app, video); rlm@47: app.start(); rlm@47: System.out.println(video.getCanonicalPath()); rlm@47: } rlm@39: }