How to convert Rosbag Pointcloud2 to Mp4

asked 2016-05-27 14:48:23 -0600

cheses100 gravatar image

So I have a bunch of rosbag files that only contain a pointcloud2 topic. I need to be play through these, and have accurate times for them, because I'm using them to tag data. This means the typical way of playing them back through rviz doesn't work for what I need. I thought I had a solution which was to use the convert_pointcloud_to_image command, and output the image to a new stream, and then use rqt to record that stream. The problem is that this isn't playing with the real times that the video should have, or in other words, it has an inconsistent frames per second, which means the timestamps are meaningless. So what I'm trying to do now is extract images from this stream using the image_view extract_images command, and the pass those images through mencoder to convert them to a video. The problem I'm now having is that my original rosbag file says it has 16793 messages, which means I need at least that many images to be created if I'm not mistaken; however, when I run the extract_images command on the converted stream, no matter what I put in the fps parameter, it still only produces somewhere on the range of 5000 images, and I'm not sure why. Does anyone know what I'm doing wrong here perhaps? Is there a better way to do what I'm trying to achieve?

edit retag flag offensive close merge delete