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

Image conversion problem with image_view video_recorder

asked 2016-03-03 03:27:39 -0500

rick187 gravatar image


I am trying to directly record a video from an image topic using video_recorder from image_view. I am testing it with my laptop camera running

roslaunch usb_cam usb_cam-test.launch

When I launch the recording with

rosrun image_view video_recorder image:="/usb_cam/image_raw" _filename:="/home/user/video.avi"

I get the following error "Unable to convert rgb8 image to bgr8". I have also tryed using

rosrun image_view video_recorder image:="/usb_cam/image_raw" _filename:="/home/user/video.avi" _encoding:="rgb8"

but this produces "Unable to convert rgb8 image to rgb8".

The exact same happens for images published by the V-REP simulator (which is what I actually need to record in the end).

Any help would be very much appreciated. Thanks.


edit retag flag offensive close merge delete


I have the same problem. Did you find a solution?

ASeyfi gravatar image ASeyfi  ( 2016-04-01 09:18:45 -0500 )edit

No, I am afraid I didn't

rick187 gravatar image rick187  ( 2016-04-01 10:37:33 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2016-04-07 07:38:41 -0500

andrea-nisti gravatar image

Hello! I just solved this issue, try to set the parameter "<param name="max_depth_range" value="0" />"enter code here . The default value is 5 and this seems to mess something up. That problem disappeared for me but I still cannot open the output video by the way.


edit flag offensive delete link more

answered 2016-04-05 23:32:42 -0500

ASeyfi gravatar image

Apparently there is a solution here

edit flag offensive delete link more

answered 2016-04-07 08:47:54 -0500

rick187 gravatar image

I have accepted the last answer because it is more complete, but the one from ASeyfi points in the right direction too. I don't know the rules in these cases.

Anyway I finally solved with this command:

rosrun image_view video_recorder image:="/usb_cam/image_raw" _filename:="/tmp/video.avi" _max_depth_range:="0" _fps:="30" _codec:="I420"

I can open the file in VLC and it works perfectly. The last option (the codec) can be removed and the video still plays fine (but it is compressed in this case).

Thank you all.


edit flag offensive delete link more

Question Tools


Asked: 2016-03-03 03:27:39 -0500

Seen: 3,179 times

Last updated: Apr 07 '16