Video

The Video library plays movie files and captures video data from a camera. Video can be captured from USB Cameras, IEEE 1394 (Firewire) Cameras, or Video Cards with composite or S-video input devices connected to the computer. Movies can be loaded from files located on your computer or anywhere on the Internet. It is based on the GStreamer multimedia framework, and uses the gstreamer-java bindings to interface GStreamer from Java to support a wide range of media formats. We recommend using H.264, but many other formats will work as well.

The source code is available on the processing-video GitHub repository. Please report bugs here.

Capture

  • Capture

    Datatype for storing and manipulating video frames from an attached capture device such as a camera.

  • available()

    Returns "true" when a new frame from the device is available to read.

  • frameRate()

    Sets how often frames are read from the capture device.

  • read()

    Reads the current frame of the device.

  • start()

    Starts capturing frames from an attached device.

  • stop()

    Stops capturing frames from an attached device.

Movie

  • Movie

    Datatype for storing and playing movies.

  • available()

    Returns "true" when a new movie frame is available to read.

  • duration()

    Returns the length of the movie in seconds.

  • frameRate()

    Sets how often frames are read from the movie.

  • jump()

    Jumps to a specific location within a movie.

  • loop()

    Plays a movie continuously, restarting it when it's over.

  • noLoop()

    If a movie is looping, this will cause it to play until the end and then stop on the last frame.

  • pause()

    Pauses a movie during playback.

  • play()

    Plays a movie one time and stops at the last frame.

  • read()

    Reads the current frame of the movie.

  • speed()

    Sets the relative playback speed of the movie.

  • stop()

    Stops a movie from continuing.

  • time()

    Returns the location of the playback head in seconds.

Video Events

  • captureEvent()

    This event function is run when a new camera frame is available

  • movieEvent()

    This event function is run when a new movie frame is available