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

How to I rosbag/record a loosless compressed images

asked 2014-02-13 23:58:56 -0500

Markus Bader gravatar image


I like to record raw images using rosbag.

rosbag record /front_camera/image_raw

Works perfect and I can view the images with

rosbag play my_bag.bag &
rosrun image_view image_view /front_camera/image_raw

But the bag files becomes get big very fast

My question is now is there a way to record images loosless compressed? Currently I see the following topics


I tried recording the /front_camera/image_raw/compressed or /front_camera/image_raw/theora butI was not able to view the recorded images using image_view.

Thanks Markus

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-03-05 05:20:51 -0500

Dereck gravatar image

Record compressed stream via:

$ rosbag record /front_camera/image_raw/compressed

Play back recording with:

$ rosbag play <bagfile>
$ rosrun image_view image_view image:=/front_camera/image_raw compressed

note the space between the raw topic and the transport type in image_view.

edit flag offensive delete link more


Keep in mind that by default, compressed_image_transport uses JPEG, which is lossy. You can use dynamic_reconfigure to switch it to PNG.

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2014-03-05 08:34:03 -0500 )edit

I have a node that processes data from a sensor_msgs/Image topic, and I don't want to modify the code. Can I apply what you just said: record a bag file with compressed images, and then and somehow convert from compressed image to "raw" image when I read directly from the bag?

Tinrik gravatar image Tinrik  ( 2014-07-07 12:43:26 -0500 )edit

Question Tools

1 follower


Asked: 2014-02-13 23:58:56 -0500

Seen: 9,676 times

Last updated: Mar 05 '14