Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
Javascript Video Capture

I have the following code. It displays filter video at top and original video at bottom.

How to hide the video at the top?

Thanks

// https://editor.p5js.org/

function setup() {
   createCanvas(320, 260);
   video = createCapture(VIDEO);
   video.size(width,height);
 }
 let video;
 function draw() {
 image(video,0,0,width,height);
 // filter(THRESHOLD); 
//  filter(GRAY);
filter(INVERT);
}
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Thank you @Samathingamajig

The following Code works for me.

let video;

function setup() {
  createCanvas(320, 260);
  video = createCapture(VIDEO);
  video.size(width, height);
  video.hide();
}

function draw() {
  image(video,0,0,width,height);
  // rest of code
}
about 4 years ago · Juan Pablo Isaza Report

0

Can we redefine it as below?

// https://editor.p5js.org/

function setup() {
   createCanvas(700, 394);
   video = createCapture(VIDEO);
   
   video.hide();
  // video.show();
 }
 let video;
 function draw() {
 image(video,0,0,width,height);
 // filter(THRESHOLD); 
 //  filter(GRAY);
 // filter(INVERT);
}
about 4 years ago · Juan Pablo Isaza Report

0

On the documenation page, it says to do video.hide() to hide the webcam capture.

And if you don't want the filter, then don't call filter(...)

So your code will look like this:

let video;

function setup() {
  createCanvas(320, 260);
  video = createCapture(VIDEO);
  video.size(width, height);
  video.hide();
}

function draw() {
  image(video,0,0,width,height);
  // rest of code
}

If you ever want to reshow the original video, just run video.show().

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!