Introduction
In this recitation I first attended the map() workshop and then chose to go to the media manipulation workshop. The exercise for the workshop is to pick a tv show/music video/entrance video and recreate it using images and videos from the web. I chose a black-and-white music video from Vimeo and decided to do something creative about it.
Processing Code to play the original video:
import processing.video.*; //import video library Movie myMovie; void setup() { size(1000, 600); myMovie = new Movie(this, "music video.mp4"); myMovie.play(); //define the state of the video } void draw() { if (myMovie.available()) { //read my file when it can be read myMovie.read(); //read the current frame of the video } image(myMovie, 0, 0); //draw the frame }
original video:
my code for speed manipulation and pixels:
import processing.video.*; //import video library Movie myMovie; void setup() { size(1000, 600); myMovie = new Movie(this, "music video.mp4"); myMovie.play(); //define the state of the video } void draw() { if (myMovie.available()) { //read my file when it can be read myMovie.read(); //read the current frame of the video } image(myMovie, 0, 0); //draw the frame float speed =map(mouseX,0,mouseY, 0,4); myMovie.speed(speed); if(keyPressed){ int rectsize = 20; int w = myMovie.width; int h = myMovie.height; for (int x=0; x<w; x+=rectsize){ for (int y=0; y<h; y+=rectsize){ int a = x+y*w; fill(myMovie.pixels[a]); rect(x, y, rectsize, rectsize); } } } }
The effect I want to create is faster speed and pixels. I used keypressed() to create rectangles with size of 20 to pixelate the video, which makes the video seem more flat and two-dimensional. Also I used map() to speed the video up according to the location of my mouse. The faster speed makes the video more exciting and the change of objects in the video more dramatic. This works well most of the times, but when it speeds up there is no sound, and sometimes the video would stuck at a scene. But the pixels and speeding up can work at the same time. Below is my recorded videos of the special effects.