How to convert video file to bag?
How do you convert a generic video file (e.g. avi or mjpeg) to bag format containing each video frame as a sensor_msgs/CompressedImage type on a specific topic, as though it were originally broadcast from a ROS camera node?
I want to test some monocular SLAM packages that only require the input of a single video feed, and instead of carting around an entire ROS computer plus camera setup, and because there's no ROS output or interaction required, it would be much easier to simply record video of someone walking through an environment separately, and then later feed that into the package. It would also allow me to create a standardized input and benchmark different algorithms.
I can find lots of examples through Google of converting video in bag files back into regular video files, but nothing about going the other way. This seems like a straight forward and common procedure, so I'd be surprised if there wasn't some pre-existing tool to do this.
How do I convert a video or a sequence of images to a bag file? seems to have some example code.