Class VideoRecorderAppState

java.lang.Object
com.jme3.app.state.AbstractAppState
com.jme3.app.state.VideoRecorderAppState
All Implemented Interfaces:
com.jme3.app.state.AppState

public class VideoRecorderAppState extends com.jme3.app.state.AbstractAppState
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.
Author:
normenhansen, Robert McIntyre, entrusC
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Field Summary

    Fields inherited from class com.jme3.app.state.AbstractAppState

    initialized
  • Constructor Summary

    Constructors
    Constructor
    Description
    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(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.
    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 quality
    VideoRecorderAppState(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 Type
    Method
    Description
    void
     
     
    float
    Get the quality used to compress the video images.
    void
    initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application app)
     
    void
    setFile(File file)
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public VideoRecorderAppState(File file)
      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

      public VideoRecorderAppState(File file, float quality)
      This constructor allows you to specify the output file of the video as well as the quality
      Parameters:
      file - the video file
      quality - the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file)
    • VideoRecorderAppState

      public VideoRecorderAppState(File file, float quality, int framerate)
      This constructor allows you to specify the output file of the video as well as the quality
      Parameters:
      file - the video file
      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
  • Method Details

    • getFile

      public File getFile()
    • setFile

      public void setFile(File file)
    • 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

      public void initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application app)
      Specified by:
      initialize in interface com.jme3.app.state.AppState
      Overrides:
      initialize in class com.jme3.app.state.AbstractAppState
    • cleanup

      public void cleanup()
      Specified by:
      cleanup in interface com.jme3.app.state.AppState
      Overrides:
      cleanup in class com.jme3.app.state.AbstractAppState