OpenCV
index
 
Name movie ( )
Examples
import hypermedia.video.*;


OpenCV opencv;

void setup() {
  size( 640, 480 );
  opencv = new OpenCV( this );
  opencv.movie( "bunny.avi", width, height );    // load movie file
}

void draw() {
  opencv.read();                  // read a new frame
  image( opencv.image(), 0, 0 );  // and display image
}
Description Allocates and initialise resources for reading a video file from the specified file name.
Movie must be located in the sketch's data directory, otherwise you must specified the full path to access to the movie file without an error.
notes : this method automatically update previous memory allocation, sound will not be available

Supported codecs and file formats depends on the video back end library :

  • Video for Windows (VfW) for Windows users
  • FFMPEG on Linux
  • QuickTime for Mac OS X

For more informations about video on OpenCV or to be able to read your video files on all platforms, see VideoCodecs

Syntax
movie(filename);
movie(filename, width, height);
Parameters
filename   String : the name of the movie file
width   int : the width of frames for the video stream
height   int : the height of frames for the video stream
Returns None
Usage Web & Application
Related