Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.video.*;
- import com.hamoid.*;
- VideoExport videoExport;
- Movie movie;
- void setup() {
- size(1280, 720);
- background(0);
- movie = new Movie(this, "beyonce.mp4");
- movie.play();
- videoExport = new VideoExport(this, "internetVideo.mp4");
- videoExport.startMovie();
- }
- void movieEvent(Movie movie) {
- movie.read();
- }
- void draw() {
- if (frameCount>5) {
- paint();
- videoExport.saveFrame();
- }
- }
- void paint() {
- if (mousePressed) {
- int sz = (int) random(25, 100);
- PImage tmp = movie.get(mouseX, mouseY, sz, sz);
- tint(255, 100);
- image(tmp, mouseX, mouseY);
- }
- // resized actual video with white dot representing the mouse position
- copy(movie, 0, 0, width, height, 0, 0, width/5, height/5);
- fill(255);
- stroke(0);
- float px = map(mouseX, 0, width, 0, width/6);
- float py = map(mouseY, 0, height, 0, height/6);
- ellipse(px, py, 5, 5);
- }
- void keyPressed() {
- if (key == 'q') {
- videoExport.endMovie();
- exit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement