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@56: /** Recording Video from your Application is simple. If all you want rlm@56: * 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@56: public static void main(String[] ignore) throws IOException { rlm@56: Application app = new HelloLoop(); rlm@56: File video = File.createTempFile("JME-simple-video", ".avi"); rlm@56: app.setTimer(new IsoTimer(60)); rlm@56: Capture.captureVideo(app, video); rlm@56: app.start(); rlm@56: System.out.println(video.getCanonicalPath()); rlm@56: } rlm@39: }