How can you blend a video into a webcam screen, or add effects to the live video?

edited April 2016 in Library Questions

I got live video on screen with this code: import*;

Capture cam;

float xpos; float ypos;

void setup() {

size(1920,1080); String[] cameras = Capture.list(); cam = new Capture(this, cameras[1]); cam.start(); } void draw() { if (cam.available() == true) {; image(cam, 339,154); } }

However, I need to know how to put images/videos on top of it. Like putting animations over it, or changing up the colors/putting a filter, ect. I think what I need might be the blend and/or saveFrame() function, but I'm not sure how to get it to work. For example, how could I blend flashing random colors using random(255) over the video? Also, can I put distortions on the webcam, as in making things pix elated, warped, etc?

In my project, I will need it to start out as a normal webcam, then when you click a button the effects happen. How would I go about doing that? I've already made a button that responds to clicking, but don't know how to make it cue the video effects.

Also, I have one last question. Can you make a button that will clear everything completely and put an entirely new sketch up? Like on webpages when you click a button and it takes you to a new webpage. If so, how?)

I'm really new at processing and don't understand anything! Thank you in advance!

Sign In or Register to comment.