You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bloggie turns up in the Available list of cameras. Although, confusingly it turns up as a number of cameras of alternate resolutions. No matter, Capture appears to "see" the bloggie.
However, the cam.available() never returns true suggesting a video frame is never available.
I have tried using various index values into cameras to, pick up alternate instances of the bloggie resolution instances, no no avail. I have tried hard coding resolutions, frame rates, camera names etc. to no avail.
MyCam reports the bloggie at a specific resolution and framerate so assuming that is the default I have made a special point of setting those parameters, to no avail.
Regardless, cam.available() never returns true.
I wrapped the capture calls in try blocks and no exceptions appear to get raised.
If I print the cam pointer it comes up with: processing.video.Capture@2d5e7ba3
So, the Capture instance appears to have been created.
So, there is no exception or other means to "explain" why the camera can be "seen" by Capture.list() but fails to return a frame.
(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.
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.
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...
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!
@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.
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.
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...
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!
@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.
Activity
Bazmundi commentedon Aug 4, 2015
Ah, if I shut the window an exception is raised:
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.
Bazmundi commentedon Aug 8, 2015
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.
txeni commentedon Aug 19, 2015
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!
Bazmundi commentedon Aug 20, 2015
@txeni yes. I will post something this weekend. Stay tuned.
txeni commentedon Aug 20, 2015
@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!
Bazmundi commentedon Aug 22, 2015
Notes on my blog for you at:
https://organicmonkeymotion.wordpress.com/2015/08/22/getting-webcams-working-in-processing/
txeni commentedon Aug 22, 2015
Thank you so much!!!
I'll have a look :)
txeni commentedon Aug 22, 2015
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!
Bazmundi commentedon Aug 22, 2015
@txeni I only poked around on the Internet, thank Bartosz Firyn who wrote the library ;) Good luck with your deadline.
txeni commentedon Aug 23, 2015
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();
txeni commentedon Aug 23, 2015
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);
}
Bazmundi commentedon Aug 23, 2015
@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.
codeanticode commentedon Sep 4, 2015
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.
txeni commentedon Sep 4, 2015
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...
jeffmarc10 commentedon Sep 3, 2017
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!
codeanticode commentedon Aug 25, 2019
@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.
codeanticode commentedon Jan 16, 2023
No updates on this issue, closing.