Mercurial > jmeCapture
comparison src/com/aurellem/capture/video/XuggleVideoRecorder.java @ 11:8a6b1684f536
refactored.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 27 Oct 2011 02:27:02 -0700 |
parents | 4c5fc53778c1 |
children | 302d5e9ad120 |
comparison
equal
deleted
inserted
replaced
10:4c5fc53778c1 | 11:8a6b1684f536 |
---|---|
10 import com.xuggle.xuggler.IRational; | 10 import com.xuggle.xuggler.IRational; |
11 | 11 |
12 | 12 |
13 /** | 13 /** |
14 * Handles writing video files using Xuggle. | 14 * Handles writing video files using Xuggle. |
15 * | 15 * |
16 * | |
17 * @author Robert McIntyre | 16 * @author Robert McIntyre |
18 * | 17 * |
19 */ | 18 */ |
20 | 19 |
21 public class XuggleVideoRecorder extends AbstractVideoRecorder{ | 20 public class XuggleVideoRecorder extends AbstractVideoRecorder{ |
37 writer.addVideoStream(videoChannel, | 36 writer.addVideoStream(videoChannel, |
38 0, IRational.make(fps), | 37 0, IRational.make(fps), |
39 width, height); | 38 width, height); |
40 this.videoReady = true; | 39 this.videoReady = true; |
41 } | 40 } |
42 | 41 |
43 | |
44 public void record(BufferedImage rawFrame) { | 42 public void record(BufferedImage rawFrame) { |
45 if (!this.videoReady){initVideo();} | 43 if (!this.videoReady){initVideo();} |
46 // convert the Image into the form that Xuggle likes. | 44 // convert the Image into the form that Xuggle likes. |
47 this.frame.getGraphics().drawImage(rawFrame, 0, 0, null); | 45 this.frame.getGraphics().drawImage(rawFrame, 0, 0, null); |
48 writer.encodeVideo(videoChannel, | 46 writer.encodeVideo(videoChannel, |