Package com.jme3.app.state
Class VideoRecorderAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
com.jme3.app.state.VideoRecorderAppState
- All Implemented Interfaces:
AppState
A Video recording AppState that records the screen output into an AVI file with
M-JPEG content. The file should be playable on any OS in any video player.
The video recording starts when the state is attached and stops when it is detached or the application is quit. You can set the fileName of the file to be written when the state is detached, else the old file will be overwritten. If you specify no file the AppState will attempt to write a file into the user home directory, made unique by a timestamp.
The video recording starts when the state is attached and stops when it is detached or the application is quit. You can set the fileName of the file to be written when the state is detached, else the old file will be overwritten. If you specify no file the AppState will attempt to write a file into the user home directory, made unique by a timestamp.
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.jme3.app.state.AbstractAppState
initialized
-
Constructor Summary
ConstructorDescriptionUsing this constructor the video files will be written sequentially to the user's home directory with a quality of 0.8 and a framerate of 30fps.VideoRecorderAppState
(float quality) Using this constructor the video files will be written sequentially to the user's home directory.VideoRecorderAppState
(float quality, int framerate) Using this constructor the video files will be written sequentially to the user's home directory.VideoRecorderAppState
(File file) This constructor allows you to specify the output file of the video.VideoRecorderAppState
(File file, float quality) This constructor allows you to specify the output file of the video as well as the qualityVideoRecorderAppState
(File file, float quality, int framerate) This constructor allows you to specify the output file of the video as well as the quality. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Called byAppStateManager
when transitioning thisAppState
from terminating to detached.getFile()
float
Get the quality used to compress the video images.void
initialize
(AppStateManager stateManager, Application app) Called byAppStateManager
when transitioning thisAppState
from initializing to running.
This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)
was called.void
void
setQuality
(float quality) Set the video image quality from 0(worst/smallest) to 1(best/largest).Methods inherited from class com.jme3.app.state.AbstractAppState
getId, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached, update
-
Constructor Details
-
VideoRecorderAppState
public VideoRecorderAppState()Using this constructor the video files will be written sequentially to the user's home directory with a quality of 0.8 and a framerate of 30fps. -
VideoRecorderAppState
public VideoRecorderAppState(float quality) Using this constructor the video files will be written sequentially to the user's home directory.- Parameters:
quality
- the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file)
-
VideoRecorderAppState
public VideoRecorderAppState(float quality, int framerate) Using this constructor the video files will be written sequentially to the user's home directory.- Parameters:
quality
- the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file)framerate
- the frame rate of the resulting video, the application will be locked to this framerate
-
VideoRecorderAppState
This constructor allows you to specify the output file of the video. The quality is set to 0.8 and framerate to 30 fps.- Parameters:
file
- the video file
-
VideoRecorderAppState
This constructor allows you to specify the output file of the video as well as the quality- Parameters:
file
- the video filequality
- the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file)
-
VideoRecorderAppState
This constructor allows you to specify the output file of the video as well as the quality.- Parameters:
file
- the video filequality
- the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file)framerate
- the frame rate of the resulting video, the application will be locked to this framerate
-
-
Method Details
-
getFile
-
setFile
-
getQuality
public float getQuality()Get the quality used to compress the video images.- Returns:
- the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file)
-
setQuality
public void setQuality(float quality) Set the video image quality from 0(worst/smallest) to 1(best/largest).- Parameters:
quality
- the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file)
-
initialize
Description copied from interface:AppState
Called byAppStateManager
when transitioning thisAppState
from initializing to running.
This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)
was called.AppStateManager
will call this only from the update loop inside the rendering thread. This means is it safe to modify the scene graph from this method.- Specified by:
initialize
in interfaceAppState
- Overrides:
initialize
in classAbstractAppState
- Parameters:
stateManager
- The state managerapp
- The application
-
cleanup
public void cleanup()Description copied from interface:AppState
Called byAppStateManager
when transitioning thisAppState
from terminating to detached. This method is called the following render pass after theAppState
has been detached and is always called once and only once for each timeinitialize()
is called. Either when theAppState
is detached or when the application terminates (if it terminates normally).- Specified by:
cleanup
in interfaceAppState
- Overrides:
cleanup
in classAbstractAppState
-