Replaying rosbag movies

Suppose we have a rosbag video: ‘/home/caveman/Downloads/20140108134157.bag’

Play the video:

rosbag play ‘/home/caveman/Downloads/20140108134157.bag’

suppose the image topic is: /camera/image_rect/compressed

To republish uncompressed video:

rosrun image_transport republish compressed in:=/camera/image_rect raw out:=/camera/image_rect

Now view the image with:

rosrun image_view image_view image:=/camera/image_rect

To extract the images:

rosrun image_view extract_images image:=/camera/image_mono

Then save to a movie:

mencoder mf://*.jpg -mf type=jpg:fps=30 -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o animation.avi