Mercurial > jmeCapture
diff src/com/aurellem/capture/video/AVIVideoRecorder.java @ 39:784a3f4e6202
updating capture-video
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 03 Nov 2011 16:00:46 -0700 |
parents | be5ac56826be |
children |
line wrap: on
line diff
1.1 --- a/src/com/aurellem/capture/video/AVIVideoRecorder.java Mon Oct 31 07:43:44 2011 -0700 1.2 +++ b/src/com/aurellem/capture/video/AVIVideoRecorder.java Thu Nov 03 16:00:46 2011 -0700 1.3 @@ -9,38 +9,38 @@ 1.4 1.5 public class AVIVideoRecorder extends AbstractVideoRecorder{ 1.6 1.7 - AVIOutputStream out = null; 1.8 - boolean videoReady = false; 1.9 - BufferedImage frame; 1.10 + AVIOutputStream out = null; 1.11 + boolean videoReady = false; 1.12 + BufferedImage frame; 1.13 1.14 - public AVIVideoRecorder(File output) throws IOException { 1.15 - super(output); 1.16 - this.out = new AVIOutputStream(output, AVIOutputStream.VideoFormat.PNG, 24); 1.17 - this.out.setVideoCompressionQuality(1.0f); 1.18 - } 1.19 - 1.20 + public AVIVideoRecorder(File output) throws IOException { 1.21 + super(output); 1.22 + this.out = new 1.23 + AVIOutputStream(output, AVIOutputStream.VideoFormat.RAW, 24); 1.24 + this.out.setFrameRate(60); 1.25 + } 1.26 1.27 - public void initVideo (){ 1.28 - frame = new BufferedImage( 1.29 - width, height, 1.30 - BufferedImage.TYPE_INT_RGB); 1.31 - out.setFrameRate((int) Math.round(this.fps)); 1.32 - out.setTimeScale(1); 1.33 - out.setVideoDimension(width, height); 1.34 - this.videoReady = true; 1.35 - } 1.36 + public void initVideo (){ 1.37 + frame = new BufferedImage( 1.38 + width, height, 1.39 + BufferedImage.TYPE_INT_RGB); 1.40 + out.setFrameRate((int) Math.round(this.fps)); 1.41 + out.setTimeScale(1); 1.42 + out.setVideoDimension(width, height); 1.43 + this.videoReady = true; 1.44 + } 1.45 1.46 - public void record(BufferedImage rawFrame) { 1.47 - if (!videoReady){initVideo();} 1.48 - this.frame.getGraphics().drawImage(rawFrame, 0, 0, null); 1.49 - try {out.writeFrame(frame);} 1.50 - catch (IOException e){e.printStackTrace();} 1.51 - } 1.52 + public void record(BufferedImage rawFrame) { 1.53 + if (!videoReady){initVideo();} 1.54 + this.frame.getGraphics().drawImage(rawFrame, 0, 0, null); 1.55 + try {out.writeFrame(frame);} 1.56 + catch (IOException e){e.printStackTrace();} 1.57 + } 1.58 1.59 - public void finish() { 1.60 - try {out.close();} 1.61 - catch (IOException e) {e.printStackTrace();} 1.62 - } 1.63 + public void finish() { 1.64 + try {out.close();} 1.65 + catch (IOException e) {e.printStackTrace();} 1.66 + } 1.67 1.68 1.69