VideoCapturer
public class MovieCapturer extends java.lang.Object implements VideoCapturer
Constructor | Description |
---|---|
MovieCapturer(java.lang.String directory) |
Constructor that takes the directory to write the
frames to
|
MovieCapturer(java.lang.String directory,
java.lang.String baseName) |
Constructor that takes the directory to write to and
the base name to use for the files
|
Modifier and Type | Method | Description |
---|---|---|
void |
captureMovie() |
Method to capture a movie until the done
flag is set to true
|
void |
captureMovie(int numSeconds) |
Method to capture a movie for the passed
number of seconds
|
void |
captureMovie(int x1,
int y1,
int width,
int height) |
Method to capture a movie until the done
flag is set to true
|
void |
captureMovie(int x1,
int y1,
int width,
int height,
int numSeconds) |
Method to capture a movie in a rectangular
region for the passed number of seconds
|
Picture |
captureRegion() |
Method to capture a region of the screen
|
Picture |
captureRegion(int x1,
int y1,
int width,
int height) |
Method to capture a part of the screen
|
Picture |
captureScreen() |
Method to capture the entire screen
|
FrameSequencer |
getFrameSequencer() |
Method to get the current directory
|
int |
getFramesPerSecond() |
Method to get the number of frames per second
|
java.awt.Rectangle |
getRegion() |
Method to get the region to capture
|
static void |
main(java.lang.String[] args) |
|
void |
playMovie() |
Method to play the captured movie
|
void |
run() |
Method to run the captured movie
|
void |
setFramesPerSecond(int frameRate) |
Method to set the number of frames per second
|
void |
setRegion(java.awt.Rectangle theRegion) |
Method to set the region to capture (makes
sure that the width and height is a multiple of
4 for compression later
|
void |
startCapture() |
Method to start capturing the movie
|
void |
startCapture(int numSeconds) |
Method to start captureing the movie and
continue for the passed number of seconds
|
void |
stopCapture() |
Method to stop capturing the movie
|
public MovieCapturer(java.lang.String directory)
directory
- the directory to write topublic MovieCapturer(java.lang.String directory, java.lang.String baseName)
directory
- the directory to write tobaseName
- the name to use for the filespublic FrameSequencer getFrameSequencer()
getFrameSequencer
in interface VideoCapturer
public int getFramesPerSecond()
getFramesPerSecond
in interface VideoCapturer
public void setFramesPerSecond(int frameRate)
setFramesPerSecond
in interface VideoCapturer
frameRate
- the number of frames per secondpublic java.awt.Rectangle getRegion()
getRegion
in interface VideoCapturer
public Picture captureScreen() throws java.lang.Exception
captureScreen
in interface VideoCapturer
java.lang.Exception
public Picture captureRegion(int x1, int y1, int width, int height) throws java.awt.AWTException
x1
- the top left xy1
- the top left ywidth
- the width of the rectangle to captureheight
- the height of the rectangle to capturejava.awt.AWTException
public Picture captureRegion() throws java.lang.Exception
java.lang.Exception
public void captureMovie()
public void run()
public void captureMovie(int numSeconds)
numSeconds
- the number of seconds to capturepublic void captureMovie(int x1, int y1, int width, int height)
x1
- the top left x valuey1
- the top left y valuewidth
- the width of the region to captureheight
- the height of the region to capturepublic void captureMovie(int x1, int y1, int width, int height, int numSeconds)
x1
- the top left x valuey1
- the top left y valuewidth
- the width of the region to captureheight
- the height of the region to capturenumSeconds
- the number of seconds to capturepublic void playMovie()
playMovie
in interface VideoCapturer
public void setRegion(java.awt.Rectangle theRegion)
setRegion
in interface VideoCapturer
theRegion
- a rectangle that encloses the region to capturepublic void startCapture()
startCapture
in interface VideoCapturer
public void startCapture(int numSeconds)
startCapture
in interface VideoCapturer
numSeconds
- the number of seconds to capturepublic void stopCapture()
stopCapture
in interface VideoCapturer
public static void main(java.lang.String[] args)