processing.video

## Class Movie

- java.lang.Object
- - processing.core.PImage
  - - processing.video.Movie

- All Implemented Interfaces:
    Cloneable, PConstants

      public class Movie
      extends PImage
      implements PConstants

  ( begin auto-generated from Movie.xml ) Datatype for storing and playing movies in Apple's QuickTime format. Movies must be located in the sketch's data directory or an accessible place on the network to load without an error. ( end auto-generated )

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `filename`
    `float` | `frameRate`
    `org.gstreamer.elements.PlayBin2` | `playbin`
    `static String[]` | `supportedProtocols`

    - ### Fields inherited from class processing.core.PImage

      `ALPHA_MASK, BLUE_MASK, format, GREEN_MASK, height, loaded, parent, pixelDensity, pixelHeight, pixels, pixelWidth, RED_MASK, width`

    - ### Fields inherited from interface processing.core.PConstants

      `ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Movie(PApplet parent, String filename)` Creates an instance of GSMovie loading the movie from filename.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `available()` ( begin auto-generated from Movie_available.xml ) Returns "true" when a new movie frame is available to read.
    `void` | `dispose()` Disposes all the native resources associated to this movie.
    `void` | `disposeBuffer(Object buf)` NOTE: This is not official API and may/will be removed at any time.
    `float` | `duration()` ( begin auto-generated from Movie_duration.xml ) Returns the length of the movie in seconds.
    `void` | `frameRate(float ifps)` ( begin auto-generated from Movie_frameRate.xml ) Sets how often frames are read from the movie.
    `int` | `get(int x, int y)`
    `boolean` | `hasBufferSink()` NOTE: This is not official API and may/will be removed at any time.
    `void` | `jump(float where)` ( begin auto-generated from Movie_jump.xml ) Jumps to a specific location within a movie.
    `void` | `loadPixels()`
    `void` | `loop()` ( begin auto-generated from Movie_loop.xml ) Plays a movie continuously, restarting it when it's over.
    `void` | `noLoop()` ( begin auto-generated from Movie_noLoop.xml ) If a movie is looping, calling noLoop() will cause it to play until the end and then stop on the last frame.
    `void` | `pause()` ( begin auto-generated from Movie_pause.xml ) Pauses a movie during playback.
    `void` | `play()` ( begin auto-generated from Movie_play.xml ) Plays a movie one time and stops at the last frame.
    `void` | `post()`
    `void` | `read()` ( begin auto-generated from Movie_read.xml ) Reads the current frame of the movie.
    `void` | `setBufferSink(Object sink)` Sets the object to use as destination for the frames read from the stream.
    `void` | `setBufferSink(Object sink, String mask)` Sets the object to use as destination for the frames read from the stream.
    `void` | `speed(float irate)` ( begin auto-generated from Movie_speed.xml ) Sets the relative playback speed of the movie.
    `void` | `stop()` ( begin auto-generated from Movie_stop.xml ) Stops a movie from continuing.
    `float` | `time()` ( begin auto-generated from Movie_time.xml ) Returns the location of the playback head in seconds.
    `void` | `volume(float v)` Change the volume.

    - ### Methods inherited from class processing.core.PImage

      `blend, blend, blendColor, clone, copy, copy, copy, filter, filter, get, get, getImage, getModifiedX1, getModifiedX2, getModifiedY1, getModifiedY2, getNative, init, init, isLoaded, isModified, mask, mask, resize, save, set, set, setLoaded, setLoaded, setModified, setModified, updatePixels, updatePixels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### supportedProtocols

          public static String[] supportedProtocols

    - #### frameRate

          public float frameRate

    - #### filename

          public String filename

    - #### playbin

          public org.gstreamer.elements.PlayBin2 playbin

  - ### Constructor Detail

    - #### Movie

          public Movie(PApplet parent,
                       String filename)

      Creates an instance of GSMovie loading the movie from filename.
      Parameters:
        `parent` - PApplet
        `filename` - String

  - ### Method Detail

    - #### dispose

          public void dispose()

      Disposes all the native resources associated to this movie. NOTE: This is not official API and may/will be removed at any time.

    - #### frameRate

          public void frameRate(float ifps)

      ( begin auto-generated from Movie_frameRate.xml ) Sets how often frames are read from the movie. Setting the fps parameter to 4, for example, will cause 4 frames to be read per second. ( end auto-generated )
      Parameters:
        `ifps` - speed of the movie in frames per second

    - #### speed

          public void speed(float irate)

      ( begin auto-generated from Movie_speed.xml ) Sets the relative playback speed of the movie. The rate parameters sets the speed where 2.0 will play the movie twice as fast, 0.5 will play at half the speed, and -1 will play the movie in normal speed in reverse. ( end auto-generated )
      Parameters:
        `irate` - speed multiplier for movie playback

    - #### duration

          public float duration()

      ( begin auto-generated from Movie_duration.xml ) Returns the length of the movie in seconds. If the movie is 1 minute and 20 seconds long the value returned will be 80.0. ( end auto-generated )

    - #### time

          public float time()

      ( begin auto-generated from Movie_time.xml ) Returns the location of the playback head in seconds. For example, if the movie has been playing for 4 seconds, the number 4.0 will be returned. ( end auto-generated )

    - #### jump

          public void jump(float where)

      ( begin auto-generated from Movie_jump.xml ) Jumps to a specific location within a movie. The parameter where is in terms of seconds. For example, if the movie is 12.2 seconds long, calling jump(6.1) would go to the middle of the movie. ( end auto-generated )
      Parameters:
        `where` - position to jump to specified in seconds

    - #### available

          public boolean available()

      ( begin auto-generated from Movie_available.xml ) Returns "true" when a new movie frame is available to read. ( end auto-generated )

    - #### play

          public void play()

      ( begin auto-generated from Movie_play.xml ) Plays a movie one time and stops at the last frame. ( end auto-generated )

    - #### loop

          public void loop()

      ( begin auto-generated from Movie_loop.xml ) Plays a movie continuously, restarting it when it's over. ( end auto-generated )

    - #### noLoop

          public void noLoop()

      ( begin auto-generated from Movie_noLoop.xml ) If a movie is looping, calling noLoop() will cause it to play until the end and then stop on the last frame. ( end auto-generated )

    - #### pause

          public void pause()

      ( begin auto-generated from Movie_pause.xml ) Pauses a movie during playback. If a movie is started again with play(), it will continue from where it was paused. ( end auto-generated )

    - #### stop

          public void stop()

      ( begin auto-generated from Movie_stop.xml ) Stops a movie from continuing. The playback returns to the beginning so when a movie is played, it will begin from the beginning. ( end auto-generated )

    - #### read

          public void read()

      ( begin auto-generated from Movie_read.xml ) Reads the current frame of the movie. ( end auto-generated )

    - #### volume

          public void volume(float v)

      Change the volume. Values are from 0 to 1.
      Parameters:
        `float` - v

    - #### loadPixels

          public void loadPixels()

      Overrides:
        `loadPixels` in class `PImage`

    - #### get

          public int get(int x,
                         int y)

      Overrides:
        `get` in class `PImage`

    - #### setBufferSink

          public void setBufferSink(Object sink)

      Sets the object to use as destination for the frames read from the stream. The color conversion mask is automatically set to the one required to copy the frames to OpenGL. NOTE: This is not official API and may/will be removed at any time.
      Parameters:
        `Object` - dest

    - #### setBufferSink

          public void setBufferSink(Object sink,
                                    String mask)

      Sets the object to use as destination for the frames read from the stream. NOTE: This is not official API and may/will be removed at any time.
      Parameters:
        `Object` - dest
        `String` - mask

    - #### hasBufferSink

          public boolean hasBufferSink()

      NOTE: This is not official API and may/will be removed at any time.

    - #### disposeBuffer

          public void disposeBuffer(Object buf)

      NOTE: This is not official API and may/will be removed at any time.

    - #### post

          public void post()

Processing video library by The Processing Foundation. (c) 2011-14