use video_recorder of image_view to recorde video of a image topic
while you need install the image_view package in ros environment.
and run roscore and video_recorder. its' param is as following:
~filename (string, default: output.avi)
- Path and name of the output video.
~fps (int, default: 15)
- Framerate of the video.
~codec (string, default: MJPG)
- The FOURCC identifier of the codec.
~encoding (string, default: bgr8)
- The image color space of the video.
an example is as following:
rosrun image_view video_recorder image:=/kinect2/hd/image_color _fps:=30
At last, if you do not change default saving directory, you will find the video created by video_recorder in home directory and the default name is output.avi.