Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masking of video no longer works #1886

Closed
povovo opened this issue Jun 13, 2013 · 4 comments
Closed

Masking of video no longer works #1886

povovo opened this issue Jun 13, 2013 · 4 comments

Comments

@povovo
Copy link

povovo commented Jun 13, 2013

In 2.0 beta 8 you could apply an image mask to a video by treating it as a PImage, sort of like this:

PImage mask_tex = loadImage("mask.png");
Movie movie = new Movie(this, "movie.mp4");
movie.mask(mask_tex);

But this no longer works in the proper release of 2.0, it just makes the video flicker instead of masking it.

@shiffman
Copy link
Member

What rendering mode are you having this bug in? i.e. does the problem exist for all or just some of the following:

size(640,360);
size(640,360,P2D);
size(640,360,P3D);

@povovo
Copy link
Author

povovo commented Jun 14, 2013

So I've done a bit more testing, here's the code I'm using:

import processing.video.*;

Movie movie;
PImage mask;

void setup() {

size(640,360, P3D);
frameRate(30);
mask = loadImage("mask-1920.png");
movie = new Movie(this, "clip.mov");
movie.play();
}

void draw() {
background(0, 0, 0);
movie.read();
movie.mask(mask);
image(movie, 10, 10);
}

I've tried it with all the different rendering modes like you suggested. It's the same thing with P2D and P3D, I just get a flicker without any masking. If I don't specify the render, like: size(640,360); then I for some reason get an error about the mask not being the same size as the image, which of course is not true.

I've also discovered that the flicker is somehow tied to the framerate of the sketch as well as the video. So if I set a framerate on the sketch that is below or equal to the framerate of the video (25Hz in this case) then I don't get any flicker, and the faster the framerate of the sketch is relative to the framerate of the video the more it flickers. However the masking does not ever work, even if I set the framerate of the sketch to 25Hz, I only get the video playing normally - without flicker but also without masking.

I should probably also mention that I have done most of the testing on Linux (Ubuntu 13.04), but I have tried it once on Windows as well using the P3D renderer and I got the same flicker there as well (and no masking).

@benfry
Copy link
Contributor

benfry commented Jul 31, 2014

Moved to processing/processing-video#12

@benfry benfry closed this as completed Jul 31, 2014
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants