View my account

Modify RGB frame pixels within .bag files and synchronize different bag streams

Comments

5 comments

  • MartyG

    Hi Bindeglied  The contents of a bag file cannot be edited.  So I agree that your best course of action would be to load the bag file into memory, edit the RGB images in real-time and then re-save the data to a new bag file.  

     

    You are also correct that bags recorded in ROS with rosbag record have some incompatibilities with playback in RealSense SDK applications such as the RealSense Viewer.  Bags recorded in ROS can be played back in ROS with the rosbag play command.

     

    The RealSense SDK cannot record multiple cameras to the same bag, so publishing the RGB of all RealSense and webcam cameras in ROS and then using rosbag record --all to record all currently active topics to the bag would seem to be the optimal option.

     

    Alternatively, synching of recorded videos from RealSense and non-RealSense cameras has previously been achieved using the TIME_OF_ARRIVAL metadata timestamp, as described at the link below.

    https://github.com/IntelRealSense/librealsense/issues/2186

    0
    Comment actions Permalink
  • Bindeglied

    Hi MartyG Thanks a lot for your insights and hints. I'll certainly switch over to rosbag then.

    But I still have one concern... Am I wrong to assume that doing rosbag play > [real-time editing of frames] > rosbag record would on its default configuration modify the "general" frame timestamps (not the TIME_OF_ARRIVAL)? My ROS knowledge is quite rusty now, so I'm just conjecturing. 

    0
    Comment actions Permalink
  • MartyG

    I believe that the timestamps will be based on global time if the RealSense SDK's metadata support is enabled, otherwise they will be based on the computer's system time.  More information about this can be found at the link below.

    https://github.com/IntelRealSense/librealsense/pull/3909

    0
    Comment actions Permalink
  • Bindeglied

    Understood. Thanks again!

    By the way, the URL you posted contains some extra characters. I just deleted everything after the pull ID #, but others reading this might not realize that.

    0
    Comment actions Permalink
  • MartyG

    Thanks very much.  I edited the link but it still will not launch correctly when clicked on.  It works if the address is copied and then pasted into the browser address bar.

    0
    Comment actions Permalink

Please sign in to leave a comment.