Why can't I use the usb-cam to collcet YUYV image?

asked 2019-08-07 03:40:47 -0500

YancenBOB gravatar image

Hi, I meet a problem about the camera image collection.

Background: I have a binocular camera. Its interface is USB 2.0 and it support the format of mjpeg and YUYV(YUV2). The image resolutions are mjpeg for 640480, 30fps; YUV2 for 640480, 336272 and 320240, 30fps. My environment is Ubuntu 16.04 and ROS Kinetic installed in the VMware Workstaion 12.

Problem: I use the ros package usb-cam to collect the color images from two cameras. The format of mjpeg 640480, 30fps has no problem. But I can not use the YUYV format. If I try the YUYV 640480, 30fps, the error is that the USB controller has not enough resources. If I try the YUYV 320*240, 30fps, the error is that:

[ERROR] [1565165733.240626042]: select timeout

Besides, I cout the encoding of mjpeg image in the rosbag and it is rgb8. In my opinion, if I choose the format 640480, 30fps, the size of a rgb8 image in one second is 2700Kb/s= 64048024/83, which is about 26MB/s. So double cameras are 52MB/s per second. It is lower than the max speed of USB 2.0 480Mbps=60MB/s. (There is a question that I have no idea about the max speed of a USB 2.0 plug with a USB 3.0 jack).

Another question: I see the topics when the usb-cam is running that it provides the /image_raw. Does it means the raw data of the image without any compression? But the format mjpeg is not lossless compression. I want to know what format of image I get from the usb-cam.

Anyone says something or advices about that? Thank you!

edit retag flag offensive close merge delete