diff 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 diff
     1.1 --- a/src/com/aurellem/capture/Capture.java	Wed Oct 26 08:54:12 2011 -0700
     1.2 +++ b/src/com/aurellem/capture/Capture.java	Wed Oct 26 09:38:27 2011 -0700
     1.3 @@ -4,6 +4,8 @@
     1.4  import java.io.IOException;
     1.5  
     1.6  import com.aurellem.capture.video.AVIVideoRecorder;
     1.7 +import com.aurellem.capture.video.AbstractVideoRecorder;
     1.8 +import com.aurellem.capture.video.XuggleVideoRecorder;
     1.9  import com.jme3.app.Application;
    1.10  import com.jme3.math.ColorRGBA;
    1.11  
    1.12 @@ -12,7 +14,18 @@
    1.13  	public static void SimpleCaptureVideo(Application app, File file) throws IOException{
    1.14  		app.getViewPort().setClearFlags(true, true, true);
    1.15  		app.getViewPort().setBackgroundColor(ColorRGBA.Black);
    1.16 -		AVIVideoRecorder videoRecorder = new AVIVideoRecorder(file); 
    1.17 +		
    1.18 +		// The XuggleVideoRecorder is better than the AVIVideoRecorder in every way
    1.19 +		// except for ease of installation.  The excellent work by Werner Randelshofer
    1.20 +		// is used as a fallback option.  Please visit http://www.xuggle.com/ to learn
    1.21 +		// how to set up the XuggleVideoRecorder.
    1.22 +		
    1.23 +		AbstractVideoRecorder videoRecorder;
    1.24 +		
    1.25 +		if (file.getCanonicalPath().endsWith(".avi")){
    1.26 +			 videoRecorder = new AVIVideoRecorder(file);}
    1.27 +		else { videoRecorder = new XuggleVideoRecorder(file); }
    1.28 +		
    1.29  		app.getStateManager().attach(videoRecorder);
    1.30  		app.getViewPort().addFinalProcessor(videoRecorder);
    1.31  	}