rs_bag2image – RealSense Conversion Tool from ROS Bag file to Image files

What is rs_bag2image?

rs_bag2image is convert tool that works on cross-platform (Windows, Linux, MacOS) for RealSense.
This tool converts all data of each stream types (Color, Depth, Infrared) that contained in ROS Bag file (*.bag) to image files (*.png, *.jpg).


rs_bag2image is open source under MIT license.
If you want to use on Windows, You can use pre-built rs_bag2image.


Image files is written to the directory created for each stream when execute command.
Color and Infrared are exported in JPEG format and Depth is exported in PNG format.
The file name is frame number. It is not sequential number starting from 000001.
Also, If a frame is dropped during recording, that frame can not be exported.


rs_bag2image -b="./file.bag" -s=true -d=true


  |   |-000001.jpg
  |   |-000002.jpg
  |   |-000001.png
  |   |-000002.png
  |-Infrared 1
  |   |-000001.jpg
  |   |-000002.jpg
  • -b
  • -b option is the path to ROS Bag file.
    It can also be described as a relative path.

  • -s
  • -s option is flag of Depth data visualization.
    If this option setting is true, depth data visualized by scaling to 8-bits will be exported to image files.
    If this option setting is false, Raw 16-bits depth data will be exported to image files.

  • -d
  • -d option is whether draw data of each streams on window.
    If this option setting is true, draw data on window.

Bug Report and Question

If you have questions or bug reports, Please post to Issues.

Leave a Reply

Your email address will not be published. Required fields are marked *