Giter VIP home page Giter VIP logo

Comments (17)

Bazmundi avatar Bazmundi commented on May 30, 2024

Ah, if I shut the window an exception is raised:

(java.exe:7388): GStreamer-CRITICAL **: 
Trying to dispose element Video Capture, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

Other people appear to have sorted by installing gstreamer. Interesting neither the Capture nor Video pages actually tell you that you might need to install a separate driver package.

Upshot, however, is installing gstreamer from gstreamer site does not fix the problem with the display not drawing (capture event not happenning?), however, it appears to have fixed the problem with the exception being raised when one closes the window.

from processing-video.

Bazmundi avatar Bazmundi commented on May 30, 2024

So I have verified the camera is fine when using another Java based library (https://github.com/sarxos/webcam-capture). I will play with using that library in Processing instead.

from processing-video.

txeni avatar txeni commented on May 30, 2024

Hi there,

I'm having the same problem with a Lenovo Yoga and with a Dell windows tablet.
Tried a lot of Processing versions 2.0.3, 2.2.1, and all the 3 betas.
As you I get available cameras, but seems not capture event happening.
Funny thing if I connect a usb camera to any of the devices that camera works...

Did you solve it?
Are you using that other library?
If so, could you post a little example, I don't really know how to start with it...

Thanks!

from processing-video.

Bazmundi avatar Bazmundi commented on May 30, 2024

@txeni yes. I will post something this weekend. Stay tuned.

from processing-video.

txeni avatar txeni commented on May 30, 2024

@Bazmundi thanks soooo much!
Please, please, please do as soon as you can, it's driving me crazy and I'm in deep deadline shit!

from processing-video.

Bazmundi avatar Bazmundi commented on May 30, 2024

Notes on my blog for you at:
https://organicmonkeymotion.wordpress.com/2015/08/22/getting-webcams-working-in-processing/

from processing-video.

txeni avatar txeni commented on May 30, 2024

Thank you so much!!!
I'll have a look :)

from processing-video.

txeni avatar txeni commented on May 30, 2024

Got the mini-screen working!
I'll keep at it to see if I can actually get the frames, basically that's what i need from the camera each individual frame to play with it.
I should be able to find a way to get them and then transform them to PImage, looking at the library examples right now.
Thank you soooooo much!

from processing-video.

Bazmundi avatar Bazmundi commented on May 30, 2024

@txeni I only poked around on the Internet, thank Bartosz Firyn who wrote the library ;) Good luck with your deadline.

from processing-video.

txeni avatar txeni commented on May 30, 2024

In case anyone else is going this route this is how I converted BufferedImage to PImage:

BufferedImage cap = webcam.getImage();
PImage screen = new PImage(cap.getWidth(),cap.getHeight(),PConstants.ARGB);
cap.getRGB(0, 0, screen.width, screen.height, screen.pixels, 0, screen.width);
screen.updatePixels();

from processing-video.

txeni avatar txeni commented on May 30, 2024

And this is how I imitated the camera example using this library:

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamPanel;
import com.github.sarxos.webcam.WebcamResolution;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.image.BufferedImage;

Webcam webcam;

void setup()
{
size(displayWidth, displayHeight);
imageMode(CENTER);

for (Webcam camlist : Webcam.getWebcams ()) {
println(camlist.getName());
for (Dimension res : camlist.getViewSizes()) println(res.toString());
}

webcam = Webcam.getDefault();
//webcam = Webcam.getWebcamByName("iLook 300 0");

webcam.setViewSize(WebcamResolution.VGA.getSize());
webcam.open(true);
}
void draw()
{
BufferedImage cap = webcam.getImage();
PImage screen = new PImage(cap.getWidth(),cap.getHeight(),PConstants.ARGB);
cap.getRGB(0, 0, screen.width, screen.height, screen.pixels, 0, screen.width);
screen.updatePixels();

image(screen, width/2, height/2);
}

from processing-video.

Bazmundi avatar Bazmundi commented on May 30, 2024

@txeni Good job! If you need any image processing BoofCV is looking very good. Infact, it turns out in the Java examples they actually use the sarxos webcam-capture library 0.3.10 so there are examples of how to get the camera image into BoofCV shenanigans.

from processing-video.

codeanticode avatar codeanticode commented on May 30, 2024

hey guys, I just saw this thread. The webcam-capture library looks really amazing, and I'm happy to know it solves the capture issues for people. I wonder if it would make sense to internally replace gstreamer for the Capture class and use webcam-capture instead.

from processing-video.

txeni avatar txeni commented on May 30, 2024

Hey, the library works fine for a lot of cameras, but some of them don't go over 640x480, i think because they use h264 compression after that, but i'm not sure, just my theory after reading this by the creator of the library:

"most of these fancy cameras with UHD resolutions comes with the dedicated software that integrates with Windows and works on top of the h.264 that is natively supported by webcam, but Java API is not able to use it (usually RGB24 format is used, or YUV, no h.264 support)." sarsox here: sarxos/webcam-capture#380

Getting newer versions of gstreamer to work with processing's video library would be amazing...

from processing-video.

jeffmarc10 avatar jeffmarc10 commented on May 30, 2024

So I am here from searching for solution to my camera issues with Processing.
Having similar problems , camera in list but not capturing, using 640x480 , still no luck
Did this integration ever happen in newer version of Processing? or is it still the same ?
Has there been any update of the video library in Processing to solve these issues?
I have tryed 4 cameras, the ones that show up as Image devices in Device manager and are UVC work up to 5MP no problem!
But other cameras that install under Sound, Video and Game controllers in Device Manager do not.
I also have a Sentech 5MP camera that uses USB3.0Vision, it installs under Sentech in Device manager and does not show up in camera list at all.
Is there any other library that would integrate with Processing for USB3 Vision support?
Thanks!

from processing-video.

codeanticode avatar codeanticode commented on May 30, 2024

@jeffmarc10 @txeni @Bazmundi Returning to this old issue, in case it is still relevant, the latest beta of the video library uses GStreamer 1.x so it might have better support for capture devices. It also has some preliminary support for custom pipelines, which could help with more specialized capture hardware, as discussed here. The beta is not available through the Contributions Manager, so you have to install it manually, but the upcoming stable v2.0 release will be.

from processing-video.

codeanticode avatar codeanticode commented on May 30, 2024

No updates on this issue, closing.

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.