Help With Video in Processing 1.5.1
in
Core Library Questions
•
1 year ago
Hello everyone,
After countless searching of topics posted on this forum I am still in need of some help with my code for an interactive kiosk I am working on. I am using classes for everything on this project; I am trying to load in some .mov files I made in Adobe After Effects CS5 and I cannot get them to work. I will post my code.
---------------------------main tab--------------------------------------------------------------------------informativeKiosk---------------------------
import processing.video.*; //importing the video library.
Movie myMovie; //calling my video Wolf Video.
XMLElement xml; //enables xml to be used.
BrownBlock myBrownBlock; //object 1
BrownBlock myBrownBlock2; //object 2
void setup() { //initial setup of sketch.
size(screen.width, screen.height); //actual size of the window at school is 1920 by 1200.
background(113, 105, 58); //color of background.
smooth(); //antialiasing on.
noStroke(); //no stroke will be given.
//noCursor(); //cursor hidden.
PFont font; //calling the font function and calling the font "font".
PImage img; //calling the image function and calling it "img".
img = loadImage("mmnhLogo.png"); //loading my image in.
image(img, 80, 70); //naming the image specifically with the variable name "img" and positioning it.
font = loadFont("FelixTitlingMT-30.vlw"); //loading in the font I desire.
textFont(font); //calling in the font I am actually going to be using; "font"
fill(245, 239, 215); //the fill of the text.
text("Midwest Museum of Natural History", 210, 125); //text and their coordinates.
font = loadFont("FelixTitlingMT-80.vlw"); //loading a different font into the sketch.
textFont(font); //calling it "font".
text("Ice Age", 210, 240); //more text and coordinates.
//myMovie = new Movie(this, "wolfVid.mov"); //calling a new object here; wolfVid.mp4.
myMovie.loop(); //loops movie for me.
//myBrownBlock = new BrownBlock(color(162,158,117)); //new object being declared.
myBrownBlock2 = new BrownBlock(color(245, 239, 215)); //new object being declared.
}
void draw() { //initiates sketch.
//myBrownBlock.display(mouseX, mouseY); //brown block 1 being controlled with the mouse.
myBrownBlock2.display(900, 500); //brown block 2 being displayed with coordinates.<---------error here!
//myMovie.display(900,500); //displaying my video on the screen of the wolf.
//if(mousePressed==true){
//save("mmnh###.png");
}
-----------------------------------------------second tab----------------------------------------brownBlock class---------------------------------------
class BrownBlock { //BrownBlock class being created.
//int xpos;
//int ypos;
color c; //color variable.
BrownBlock(color tempC){ //temporary variables are initiated.
c = tempC; //c is declared.
//int xpos = width/2;
//int ypos = height/2;
}
void display(int xpos, int ypos){ //function void display is positioned with xpos and ypos.
rectMode(CENTER); //rectangle is drawn from the center.
fill(c); //fill of the rectangle is variable c.
rect(xpos,ypos,600,300); //coordinates of the rectangle.
}
-------------------------------------------------third tab------------------------------------------------movieClass------------- for my first slide show
class Movie{ //class wolf being created.
// Movie(){ //data of class.
// Movie(this, "wolfVid.mp4.mp4"); //actual video of the class being created.
// Movie(this, "wolfVid.mp4.mp4", 15);
// Movie(this, computer,NIU(E:),informativeKiosk,data);
// Movie(this, computer,NIU(E:),informativeKiosk,data,15);
}
void display(int xpos, int ypos){ //functionality of the class.
rect(xpos,ypos,600,300); //coordinates of the video.
}
void loop(){
myMovie.loop();
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Basically I am getting better with processing, but I have never worked with video before in this program, and I am unsure whether or not I am going about this correctly? I have a good handle on classes thanks to the OOP search I get on the main website. For some reason the error is saying the "function display(int,int) does not exist. I thought it did because I see the function in the BrownBlock class? I also have the "Processing: A Programming Handbook for Visual Designers and Artists" book which is great! Although there is no mention of video in the book that I could find in the index. Any help would be greatly appreciated thank you.
Safety and Peace,
playalot86
1