Class GifVideoRecorder

java.lang.Object
org.opensourcephysics.media.core.ScratchVideoRecorder
org.opensourcephysics.media.gif.GifVideoRecorder
All Implemented Interfaces:
VideoRecorder

public class GifVideoRecorder extends ScratchVideoRecorder
This is a gif video recorder that uses scratch files.
Version:
1.0
Author:
Douglas Brown
  • Constructor Details

    • GifVideoRecorder

      public GifVideoRecorder()
      Constructs a GifVideoRecorder object.
  • Method Details

    • setFrameDuration

      public void setFrameDuration(double millis)
      Sets the time duration per frame.
      Specified by:
      setFrameDuration in interface VideoRecorder
      Overrides:
      setFrameDuration in class ScratchVideoRecorder
      Parameters:
      millis - the duration per frame in milliseconds
    • getGifEncoder

      public AnimatedGifEncoder getGifEncoder()
      Gets the encoder used by this recorder. The encoder has methods for setting a transparent color, setting a repeat count (0 for continuous play), and setting a quality factor.
      Returns:
      the gif encoder
    • saveScratch

      protected void saveScratch()
      Saves the video to the current scratchFile.
      Specified by:
      saveScratch in class ScratchVideoRecorder
    • startRecording

      protected boolean startRecording()
      Starts the video recording process.
      Specified by:
      startRecording in class ScratchVideoRecorder
      Returns:
      true if video recording successfully started
    • append

      protected boolean append(Image image)
      Appends a frame to the current video.
      Specified by:
      append in class ScratchVideoRecorder
      Parameters:
      image - the image to append
      Returns:
      true if image successfully appended
    • getCodec

      public String getCodec()