I attended Leon’s recitation about media manipulation. After going through the basic codes for using images or videos to make media manipulations, I downloaded a video called The Whale which tells a story that a man was looking for whales to kill using a telescope, and did not realize that he was stepping right on a whale, which was hiding itself in this way to escape from being killed. I also downloaded a Pepe frog meme saying “Be Nice Man” to put into this exercise.
After importing the video and the image using “import processing.video.*” and “PImage”, I adjusted the speed into the 1.2 times of the original. The new function that I have learned from this recitation which is very useful is video.time(), which is counted by seconds. With the help of this function, the image appears at the 30th second and disappears at the 34th second.
Apart from doing the recitation exercise, I also asked a question about my final project that how I can slow down an animation array without touching the framerate. Thanks to Jingyi’s help, I learned that instead of using the Photoshop to create series of pngs of animation, using After Effect to create an mp4 video is a better choice, before which I should cut more slices for the animation.
Code:
import processing.video.*;
Movie whale;
PImage frog;
void setup(){
size(1000,600);
whale=new Movie (this, “The Whale.mp4”);
whale.loop();
frog= loadImage(“nice.png”);
}
void draw(){
if(whale.available()){
whale.read();
whale.speed(1.2);
}
image(whale,0,0,1000,600);//////////
float timeStamp = whale.time();
println(timeStamp);
if(timeStamp >=30 && timeStamp <=34){
image(frog,400,250,200,200);
}
}