annotate src/com/aurellem/capture/Capture.java @ 10:4c5fc53778c1

moved randelshofer stuff to rightfull place, enabled XuggleVideoRecorder
author Robert McIntyre <rlm@mit.edu>
date Wed, 26 Oct 2011 09:38:27 -0700
parents 5dfc9e768816
children 8a6b1684f536
rev   line source
rlm@3 1 package com.aurellem.capture;
rlm@3 2
rlm@3 3 import java.io.File;
rlm@3 4 import java.io.IOException;
rlm@3 5
rlm@9 6 import com.aurellem.capture.video.AVIVideoRecorder;
rlm@10 7 import com.aurellem.capture.video.AbstractVideoRecorder;
rlm@10 8 import com.aurellem.capture.video.XuggleVideoRecorder;
rlm@3 9 import com.jme3.app.Application;
rlm@3 10 import com.jme3.math.ColorRGBA;
rlm@3 11
rlm@3 12 public class Capture {
rlm@3 13
rlm@3 14 public static void SimpleCaptureVideo(Application app, File file) throws IOException{
rlm@3 15 app.getViewPort().setClearFlags(true, true, true);
rlm@3 16 app.getViewPort().setBackgroundColor(ColorRGBA.Black);
rlm@10 17
rlm@10 18 // The XuggleVideoRecorder is better than the AVIVideoRecorder in every way
rlm@10 19 // except for ease of installation. The excellent work by Werner Randelshofer
rlm@10 20 // is used as a fallback option. Please visit http://www.xuggle.com/ to learn
rlm@10 21 // how to set up the XuggleVideoRecorder.
rlm@10 22
rlm@10 23 AbstractVideoRecorder videoRecorder;
rlm@10 24
rlm@10 25 if (file.getCanonicalPath().endsWith(".avi")){
rlm@10 26 videoRecorder = new AVIVideoRecorder(file);}
rlm@10 27 else { videoRecorder = new XuggleVideoRecorder(file); }
rlm@10 28
rlm@3 29 app.getStateManager().attach(videoRecorder);
rlm@3 30 app.getViewPort().addFinalProcessor(videoRecorder);
rlm@3 31 }
rlm@3 32
rlm@3 33
rlm@3 34
rlm@3 35
rlm@3 36
rlm@3 37 }