Ask Your Question
0

usb-cam using deprecated pixel format

asked 2021-04-15 17:39:36 -0500

golferGuy1145 gravatar image

updated 2021-04-16 19:15:38 -0500

I am using ubuntu mate 20.04 focal and i have installed ros noetic, I am trying to use a logitech c920 webcam, however when i run rosrun usb_cam usb_cam_node i get the following error [swscaler @ 0x229f390] no accelerated colorspace conversion from yuv422p to rgb24, [swscaler@ 0x229f390] deprecated pixel format used, make sure you set the range correctly

i read that these are just warnings however, when i run rosrun rviz rviz it doesn't display the image from the webcam

the webcam does work though if i open it through Cheese or vlc it displays just fine

i have tried using the fixes found here

https://answers.ros.org/question/1735...

and here

https://github.com/ros-drivers/usb_ca...

and here

https://github.com/ros-drivers/usb_ca...

however, no of these solutions have seemed to work i've also tried changing the ffmpeg code in the usb_cam.cpp code but i haven't been able to get that to work either.... when i run v4l2-ctl --list-formats-ext -d /dev/video0 i get the following
ioctl: VIDIOC_ENUM_FMT Type: Video Capture

[0]: 'YUYV' (YUYV 4:2:2)
    Size: Discrete 640x480
        Interval: Discrete 0.033s (30.000 fps)
        Interval: Discrete 0.042s (24.000 fps)
        Interval: Discrete 0.050s (20.000 fps)
        Interval: Discrete 0.067s (15.000 fps)
        Interval: Discrete 0.100s (10.000 fps)
        Interval: Discrete 0.133s (7.500 fps)
        Interval: Discrete 0.200s (5.000 fps)

i think the problem is that it's using deprecated ffmpeg code to try and convert it from yuyv to mjpeg? but i'm not sure if i'm right about this....

how do i fix this? please help..... is there another ros package that i could try?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-11-16 05:19:14 -0500

SamRodriguez gravatar image

updated 2021-11-16 05:19:44 -0500

I had the same problem, I solved it by adding _pixel_format:="yuyv" to the rosrun command. I hope this helps.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-04-15 17:39:36 -0500

Seen: 1,010 times

Last updated: Nov 16 '21