Giter Site home page Giter Site logo

Comments (3)

MAKIO135 avatar MAKIO135 commented on June 14, 2024

Stil failing with Processing 3.1.1 on Windows 8.1

May be related but displaying cam inside a PGraphics also fails in P2D:

import processing.video.*;

Capture video;
PGraphics pg;

void setup() {
    size(320, 240, P2D);

    video = new Capture(this, width, height);
    video.start(); 

    pg = createGraphics(width, height);
    pg.beginDraw();
    pg.background(255, 0, 0);
    pg.endDraw();
}

void draw() {
    if (video.available()) {
        video.read();
        pg.beginDraw();
        pg.image(video, 0, 0);
        pg.endDraw();
    }

    image( pg, 0, 0);
}

from processing-video.

bmFicg avatar bmFicg commented on June 14, 2024

Still an issue. Maybe some changes to the list method. With cameras[1] the smallest available resolution, it works again.

Tested on Windows 10 Processing 3.3.3

import processing.video.*;

Capture cam;

void setup() {
  size(640, 480, P2D);
  String[] cameras = Capture.list();
  cam = new Capture(this, cameras[1]);
  cam.start();
}

void draw() {
  if (cam.available() == true) {
    cam.read();
  }
  image(cam, 0, 0, width, height);
  cam.loadPixels();
}  

from processing-video.

codeanticode avatar codeanticode commented on June 14, 2024

@shiffman Yes, calling loadPixels() with the OpenGL renderer slows down the sketch because image data needs to be copied from GPU memory, so it is not recommended, specially for large resolutions,

from processing-video.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.