Converting a bag with uncompressed Images to CompressedImages
I have an offline program that will bag.write sensor_msgs/Image and would rather compress them into a smaller format (e.g. JPEG) for easier streaming. Compressing the bags with bz2 or lz4 is insufficient. How do I do this offline (without using compressed image transport and publishing/subscribing) in C++ (for initial creation) and/or Python (post processing script on existing bags)?