ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Time difference in showed and actual webcam image

asked 2012-11-21 07:12:42 -0500

dinamex gravatar image

updated 2014-01-28 17:14:19 -0500

ngrennan gravatar image

Hi all,

I'm using a Pandaboard ES (ARM) and would like to synchronize a webcam (logitech c920) and a kinect. I want to grab single frames on a keypress and save pcd and jpg to disk. Unfortunately is there a big lag in the webcam image which prevents me from a good result. I would like to know if there is a way to avoid the lag of 2-5 sec of my webcam image (high resolution 2304 x 1536 / YUYV format)? I tried usb_cam, uvc_camera (which is not working properly see this topic) and the gscam package. But unfortunately all of them have a big lag between the showed and the actual image. I know that the frame rate will be low ,which is not a big problem, its more that the data is the wrong one when I want to save it.

Edit 1: I looked for some unwanted queue as tfoote mentioned. The usb_cam package which seems for me to have a queue size of 1 and my subscriber uses queue size of 1, too. Could it be something else or am I wrong with the usb_cam?

Edit 2: I realized that my camera offers MJPEG compression directly on the webcam. This works together with the usb_cam package and I get a much higher frame rate (around 10 fps without paralleled kinect capturing and around 5 with the kinect capturing). The lag now is around 1 second but the resolution is also lower with 1920x1080. My first guess was that the camera has a internal memory which gets filled when the frames are not processed in time. Therefore I lowered the frame rate directly within the v4l2 driver to 5fps. This didn't brought better results also.

Would be great to get your thoughts about this problem?

side note: I get follwoing warning when using MJPEG compression

[swscaler @ 0x1c57aa0] No accelerated colorspace conversion found from yuv422p to rgb24.

which is probably a ffmpeg related and issue and regarding to their forum shouldn't cause big problems. I tried to solve it by installing various versions of ffmpeg without success.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
0

answered 2013-01-09 09:19:25 -0500

dejanpan gravatar image

usb_cam driver does not buffer anything internally. Possible reasons for your lag are:

  • Pandaboard and computer running e.g. image_view are not time synchronized
  • Pandaboard can not serialize msgs fast enough
  • Wireless connection does not offer enough bandwidth (we are experimenting with the arm processor on the tobi board and we do not get more than 300K of a bandwidth)

D.

edit flag offensive delete link more

Comments

Im not transfering anything and don't use image_view. I have a subscriber node which listens to both topics (webcam and kinect), synchronizes and saves them when I press a key.

dinamex gravatar image dinamex  ( 2013-01-09 10:38:47 -0500 )edit
0

answered 2014-03-19 14:13:09 -0500

ypl gravatar image

I am interested in knowing how you synchronize the kinect and the webcam. I have two webcams of the same model and 2 kinects.

edit flag offensive delete link more
0

answered 2012-11-26 06:16:42 -0500

tfoote gravatar image

Make sure to set your send and receive queue sizes low. If you're processing slower than data is being sent you will see this sort of lag.

edit flag offensive delete link more

Comments

I'm using the usb_cam package which seems for me to have a queue size of 1 and my subscriber uses queue size of 1, too. Could it be something else or am I wrong with the usb_cam?

dinamex gravatar image dinamex  ( 2012-12-09 12:13:40 -0500 )edit
0

answered 2012-11-26 03:24:55 -0500

Ken gravatar image

Try libuvc_camera ('fuerte' branch if you're using fuerte).

edit flag offensive delete link more

Comments

could it be that this package is just for fuerte? how do I install it on electric?

dinamex gravatar image dinamex  ( 2012-11-26 04:57:00 -0500 )edit

I don't think it uses anything that was new in fuerte, so the fuerte branch should work on electric, too.

Ken gravatar image Ken  ( 2012-11-26 08:19:09 -0500 )edit

Question Tools

Stats

Asked: 2012-11-21 07:12:42 -0500

Seen: 1,586 times

Last updated: Mar 19 '14