Mercurial > jmeCapture
view 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 |
line wrap: on
line source
1 package com.aurellem.capture;3 import java.io.File;4 import java.io.IOException;6 import com.aurellem.capture.video.AVIVideoRecorder;7 import com.aurellem.capture.video.AbstractVideoRecorder;8 import com.aurellem.capture.video.XuggleVideoRecorder;9 import com.jme3.app.Application;10 import com.jme3.math.ColorRGBA;12 public class Capture {14 public static void SimpleCaptureVideo(Application app, File file) throws IOException{15 app.getViewPort().setClearFlags(true, true, true);16 app.getViewPort().setBackgroundColor(ColorRGBA.Black);18 // The XuggleVideoRecorder is better than the AVIVideoRecorder in every way19 // except for ease of installation. The excellent work by Werner Randelshofer20 // is used as a fallback option. Please visit http://www.xuggle.com/ to learn21 // how to set up the XuggleVideoRecorder.23 AbstractVideoRecorder videoRecorder;25 if (file.getCanonicalPath().endsWith(".avi")){26 videoRecorder = new AVIVideoRecorder(file);}27 else { videoRecorder = new XuggleVideoRecorder(file); }29 app.getStateManager().attach(videoRecorder);30 app.getViewPort().addFinalProcessor(videoRecorder);31 }37 }