Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.video.*;
- Movie movie;
- PGraphics pg;
- float scal = 3, r;
- int w, h, x, y, c;
- PImage tmp;
- boolean changeBM=true;
- void setup() {
- size(1280, 720, P2D);
- background(255);
- tmp = createImage(720, 360, RGB);
- movie = new Movie(this, "sample.mp4");
- movie.loop();
- movie.speed(.5);
- imageMode(CENTER);
- }
- void draw() {
- //tint(255, 150);
- if (frameCount%300==0) {
- changeBM =! changeBM;
- }
- if (changeBM) {
- blendMode(DARKEST);
- } else {
- blendMode(LIGHTEST);
- }
- if (frameCount%10==0) drawStuff();
- // filter(GRAY);
- }
- // Called every time a new frame is available to read
- void movieEvent(Movie m) {
- m.read();
- }
- void drawStuff() {
- tint(255, 50);
- tmp = movie;
- //scale(2);
- pushMatrix();
- translate(width/2, height/2);
- //rotate(r);
- image(tmp, 0, 0);
- popMatrix();
- //r += radians(3);
- }
- void keyPressed() {
- saveFrame("image-###.jpg");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement