How to get a video playing in proccessing

edited February 2015 in Library Questions

Hello fellow coders, I'm working on a project whereby there is a video of me saying words in a form of abstract poetry. I created a processing sketch whereby every time the user clicks on the screen it jumps to a random part of the video. That part I have managed to do fine using the myMovie.jump(random(myMovie.duration())); function however, I was trying to get it so that everytime the user clicks on the screen it takes the word I said in the video and matches it with the words I put in a string that picks the words at random and displays them on the black screen.

void mousePressed() {

int r = (int)random(words.length); String randomWord = words[r];

fill(0); println(randomWord);

Originally I wanted to split the video into parts where I say each word(s) but it wasn't working properly, can someone help me please :(

heres the all the code

import processing.video.*; Movie myMovie; //yourMovie,rapMovie String[] words = {"broken", "dreams", "mean" , "seen", "happen", "rapping", "pills"," alive", "stepped on", "drive", "strong", "hidden pages", "rearrange it", "change", "save", "blood", "made it"," x and luther", "dying", "corner", "poets", "history", "poverty", "debt", "rappers", "money", "bottles", "greed pride", "hate", "crashed", "thoughts", "suicide", "past", "tragedy", "grieving", "weary eyes", "disguise", "serenity", "destiny", "top", "africa", "one love", "erase", "memories", "emotion", "pray", "bred", "creativity", "pain", "music", "therapy", "race", "delegate", "overtime", "youth", "treated", "rougher", "mother", "kind", "drake", "inspired" , "violent", "raw", "success", "fear", "dad", "dark", "year", "struggle", "motivated", "friends", "shine", "pac", "positivity", "infinity", "90's", "driven image", "teach", "children", "hell", "scars", "shoot for mars", "re adopt", "generation", "sun up", "hip hop", "greatest culture", "every day chances", "my vision"," canvas", "perfection", "dreams", "active", "no violence","Recipe" , "better", "deeds", "message", "plant", "better seeds", "longevity", "legacy", "progressive", "meant this", "sound", "effective", "message", "lifestyle", "possessive", "society", "humble", "bring", "fell with", "till death", "put my best", "till I'm resting", "team", "living", "moment", "focused", "basics", "momma's basement", "impatient", "rookie", "chasing", "recognition", "diverse", "each diverse", "adjust", "terrains", "flame"

};

void setup() { size(1080, 720); frameRate(30); myMovie = new Movie(this, "FINALPROJECTVIDEO2.mov"); myMovie.loop(); //yourMovie = new Movie(this, "meanseen.mov"); //yourMovie.play(); //rapMovie= new Movie(this, "happenrapping.mov"); //rapMovie.play();

}

void draw() { if (myMovie.available()) { myMovie.read(); //needed to display movie

} image(myMovie, 0, 0); //image(yourMovie, 120, 0); //image(yourMovie,200, 0);

}

void mousePressed() {

int r = (int)random(words.length); String randomWord = words[r];

fill(0); println(randomWord);

myMovie.jump(random(myMovie.duration())); //yourMovie.jump(random(yourMovie.duration())); //rapMovie.jump(random(rapMovie.duration())); }

Tagged:

Answers

Sign In or Register to comment.