Raw framegrabber issue

30 views
Skip to first unread message

sami...@gmail.com

unread,
Jul 18, 2013, 2:18:22 PM7/18/13
to v4...@googlegroups.com
Hi Gilles

Another query, for the logitech C920 on ubuntu12.04 ,
i am not able to get rawframegrabber and  YUV / YVU frame grabbers working.
however device info suggest that they are supported. Is it possible for you to add few more buttons
in test gui first screen "Run Raw Viewer", "Run BGR Viewer",  "Run YUV Viewer" and "Run YVU Viewer"
IF the device supports the above encodeable/Raw formats, if these buttons ar available we will have the means to test ALL
framegrabbers types supported.

running ant test-gui i get the following for c920

Native Format         YUYV-MJPEG
RGB24 encodable  YUYV-MJPEG
BGR24 encodable  YUYV-MJPEG
YUV420 encodable  YUYV-MJPEG
YVU420 encodable  YUYV-MJPEG
JPEG encodable     MPEG-YUYV-RGB24-BGR24-YUV420

In my app i create a short "format" list in a combo box containing
YUYV              //from native fromat
MJPEG            //from native fromat
RGB24             //add this if vd.supportRGBConversion returns true
BGR24            //add this if vd.supportBGRConversion returns true
YUV420           //add this if vd.supportYUVConversion returns true
YVU420          //( this is not listed in test-gui, but i get true when i call vd.supportYVUConversion(), so added in my list)
JPEG             //add this if vd.supporJPEGConversion return true

when the user selects a "format" string from above list, i check if the selection was an encodeable format i.e. RGB24, BGR24, YUV420, YVU420, JPEG
and then go the the switch case below to construct the framegrabber, if the selection is NOT encodeable format
i check if it is NATIVE i.e. YUYV, MJPEG and branch into the else below

if(encodable)
{
                switch(index)
                {
                    case 0:        //"BGR24"
                                grabber = videoDevice.getBGRFrameGrabber(width, height, 0, V4L4JConstants.STANDARD_WEBCAM);  // this works
                                break;
                               
                    case 1:        //"JPEG"
                                grabber = videoDevice.getJPEGFrameGrabber(width, height, 0, V4L4JConstants.STANDARD_WEBCAM, 80);  // this works
                                break;
       
                    case 2:        //"RGB24"
                                grabber = videoDevice.getRGBFrameGrabber(width, height, 0, V4L4JConstants.STANDARD_WEBCAM);  // this works
                                break;
       
                    case 3:        //"YVU420"
                                grabber = videoDevice.getYVUFrameGrabber(width, height, 0, V4L4JConstants.STANDARD_WEBCAM);  // FAILS no frame are updated, NO exceptions
                                break;
                   
                    case 4:        //"YUV420"
                                grabber = videoDevice.getYUVFrameGrabber(width, height, 0, V4L4JConstants.STANDARD_WEBCAM); // FAILS no frame are updated, NO exceptions
                                break;
                               
                }
}
else
{
            //native
                DeviceInfo devInfo = videoDevice.getDeviceInfo();
                ImageFormat imgformat = devInfo.getFormatList().getNativeFormat(format); // formt name from the combo list above
                int input = devInfo.getInputs().get(0).getIndex();
               
                grabber = videoDevice.getRawFrameGrabber(width, height, input, V4L4JConstants.STANDARD_WEBCAM, imgformat); // FAILS no frame are updated, NO exceptions

}

and in my NEXTFRAME method
    imp.setImage(frame.getBufferedImage());

so is frame.getBufferedImage() supported in Raw / YUV / YVU framegrabbers?

Regards

sami...@gmail.com

unread,
Jul 19, 2013, 11:02:56 PM7/19/13
to v4...@googlegroups.com
 From the API documents I understand that raw frame grabbers do not support getBuffered Image
and UnsupportedMethodException should be thrown. Since this exception was not thrown, I was wondering as to what was going on inside v4l4j

But the YUV and the YVU frame grabbers still don't work?


Regards

Gilles Gigan

unread,
Jul 20, 2013, 10:50:52 PM7/20/13
to v4...@googlegroups.com
Hi,
I confirmed YUV, YVU and raw grabbers are working correctly. They do throw an UnsupportedMethod exception when you call frame.getBufferedImage(), so I m not sure why you are not seeing this.
Gilles






Regards

--
You received this message because you are subscribed to the Google Groups "v4l4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v4l4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

sami...@gmail.com

unread,
Jul 21, 2013, 11:23:46 PM7/21/13
to v4...@googlegroups.com
i extracted the raw byte from YUV frame grabber and the data seems to be all there...
No idea as to why the exception does not fire.

Regards

Gilles Gigan

unread,
Jul 21, 2013, 11:27:43 PM7/21/13
to v4...@googlegroups.com
Can you send the code ?
I modified the au.edu.jcu.v4l4j.examples.GetFrameRate to call frame.getBufferedImage(), and it did throw an exception when using a YUV grabber.




Regards

--
Reply all
Reply to author
Forward
0 new messages