Rosanswers logo


I followed the tutorial [http://www.ros.org/wiki/rosbag/Tutorials/Exporting%20image%20and%20video%20data] about extracting video from bag file. I create a launch file like this

  <node pkg="rosbag" type="rosbag" name="rosbag" args="play -d 2 $(find image_view)/Data/test1.bag"/>
  <node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="node">
    <remap from="image" to="/camera/image_raw"/>

But than got the following error

ERROR: cannot launch node of type [rosbag/rosbag]: can't locate node [rosbag] in package [rosbag]

Im using ROS Fuerte and Ubuntu 10.4. Any help??

This is my bag file info

version: 2.0 duration: 1:32s (92s) start: Apr 01 2011 14:17:41.82 (1301627861.82) end: Apr 01 2011 14:19:14.15 (1301627954.15)

size:        260.5 MB
messages:    6530
compression: none [284/284 chunks]
types:       sensor_msgs/Image     [060021388200f6f0f447d0fcd9c64743]
             sensor_msgs/Imu       [6a62c6daae103f4ff57a132d6f95cec2]
             sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369]
topics:      /camera/image_raw   1135 msgs    : sensor_msgs/Image    
             /imu/data           1802 msgs    : sensor_msgs/Imu      
             /scan               3593 msgs    : sensor_msgs/LaserScan


Originally posted by Astronaut on ROS Answers with karma: 330 on 2012-09-28

Post score: 2

Original comments

Comment by joq on 2012-09-29:
How best to extract video depends on what you want to do with it. Please edit your question to provide that information. (Your time-stamp question was asked and answered separately).


2 Answers 2


Rosanswers logo

Regarding your first question:

I would like to know how to extract video from the bagfile?

I would recommend reading this tutorial from from ROS image_view wiki page.


I summarized the steps needed to create the video in this tutorial: How to extract images from a rosbag file and convert them to video

Originally posted by Mani with karma: 1704 on 2012-09-28

This answer was ACCEPTED on the original site

Post score: 3

Original comments

Comment by Astronaut on 2012-10-01:
I already done the tutorial and got an Error. I posted that in edit question. Any help??

Comment by jarvisschultz on 2012-10-01:
There seems to be a mistake on the wiki page (I just fixed it). The correct string in the rosbag tag entry is type="play"

Comment by Astronaut on 2012-10-01:
Still not working. I go this error. [FATAL] [1349151684.419671013]: Error opening file: play process[extract-3]: started with pid [5008] [ INFO] [1349151684.550808285]: Initialized sec per frame to 0.100000 [rosbag-2] process has died [pid 4996, exit code 1, cmd /opt/ros/fuerte/share/rosbag/bin/play

Comment by Mani on 2012-10-01:
I updated my answer with a link to steps that I usually use.

Comment by Astronaut on 2012-10-01:
Sorry. Where did you updated the answer?? On the wiki page??Sorry I saw. But Im using ROS Fuerte and Ubuntu 10.4 and I got the following error. Couldn't find package mjpeg-tools

Comment by Mani on 2012-10-01:
I think the name for 10.04 used to be mjpegtools: https://launchpad.net/ubuntu/lucid/+package/mjpegtools

Comment by Astronaut on 2012-10-01:
Ok. But have problems with rosrun image_view extract_images _sec_per_frame:=0.01 . So First I execute osrun image_view extract_images sec_per_frame:=0.01. Yes?? Than image:=. What means IMAGETOPICINBAGFILE???When I put the image path I got an error

Comment by Astronaut on 2012-10-01:
And after rosrun image_view extract_images _sec_per_frame:=0.01 I got [ WARN] [1349156876.990156648]: extract_images: image has not been remapped! Typical command-line usage: $ ./extract_images image:= [transport]

Comment by Astronaut on 2012-10-01:
Ok. It works. Thanks very much


Rosanswers logo


I wrote a python script that will directly output a video file from a ros bag without the need to convert them to images first. https://github.com/mlaiacker/rosbag2video

This tool will also convert the images to a fixed frame rate to get a real-time video.

You need to have avconv installed!

just type:

./rosbag2video.py yourbag.bag

and you will get a video file <topic>.mp4 with 25 fps and h264 encoded

Originally posted by mlaiacker with karma: 21 on 2016-01-11

This answer was NOT ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.