ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

How to rosbag play images when using theora?

asked 2011-12-20 19:13:07 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi everyone!

We are having issues when trying to replay videos from a bag file when using theora. I created a bag file with theora messages, but when I do rosbag play and use the image_view with proper image_transport set to theora, I cannot see any images. When using compressed instead of theora in the same way it works fine. Please, is there some trick how to play bag files with theora images and view them using image_view? Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2012-02-21 03:21:59 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi,

I had exactly the same problem. It seems that when playing the theora compressed data from rosbag, the image_view is not able to connect quickly enough to the advertised topic in order to receive the three critical header frames (0,1,2). These header frames are required to initialize the theora video stream reception.

So at first, start the image view:

rosrun image_view image_view image:=<your image="" topic=""> theora

Then start rosbag with the additional parameter -d SEC that will force the rosbag to sleep SEC seconds after every advertise call (to allow subscribers to connect):

rosbag play <your bag="" file=""> -d 1

You could try to play around with different values. For me, a delay of 1 sec did the trick.

Br, Paul

edit flag offensive delete link more

Comments

You should consider adding this to the theora_image_transport wiki page

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2012-02-21 03:51:29 -0500 )edit
0

answered 2013-03-19 13:40:57 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I added a comment to the git issue tracker that addresses this problem: https://github.com/ros-perception/image_transport_plugins/issues/4

Due to a flaw in the design of the theora image transport plugin, theora in rosbags only works if you record the very first message that is generated on the compressed topic. If you miss that one, you will lose the theora header information and you won't be able to decode the video stream.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-12-20 19:13:07 -0500

Seen: 1,906 times

Last updated: Mar 19 '13