Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It would be awesome if dealing with images could be so easy! Unfortunately that is not the case :/

A few things: 1) The */image_raw/compressed topic is actually of the rosmsg type sensor_msgs/CompressedImage.

lol@lel:~$ rosmsg info sensor_msgs/CompressedImage                                                                      
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string format
uint8[] data

The data field is the actual payload, which needs to be converted into a jpg/png as per the official structure: https://en.wikipedia.org/wiki/JPEG#Syntax_and_structure

One way to do this is to use the cv_bridge to subscribe to the image topic, and then save to jpg/png on every run of the callback. (really there should be a node to do this .. but I can't find one :/ if you find one, please share!)

Once you have all of those jpgs, then can you coallate them into an mp4 video https://stackoverflow.com/questions/22965569/convert-from-jpg-to-mp4-by-ffmpeg

I hope this helps. Good luck!

Edit: actually did a quick search and found this to be helpful: http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data

It would be awesome if dealing with images could be so easy! Unfortunately that is not the case :/

A few things: 1) The */image_raw/compressed topic is actually of the rosmsg type sensor_msgs/CompressedImage.

lol@lel:~$ rosmsg info sensor_msgs/CompressedImage                                                                      
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string format
uint8[] data

The data field is the actual payload, which needs to be converted into a jpg/png as per the official structure: https://en.wikipedia.org/wiki/JPEG#Syntax_and_structure

One way to do this is to use the cv_bridge to subscribe to the image topic, and then save to jpg/png on every run of the callback. (really there should be a node to do this .. but I can't find one :/ if you find one, please share!)

Once you have all of those jpgs, then can you coallate them into an mp4 video https://stackoverflow.com/questions/22965569/convert-from-jpg-to-mp4-by-ffmpeg

I hope this helps. Good luck!