# Theora image latency

I have several cameras - different models and different ros drivers - that show significant latency (about one second) between theora and image_raw, while there is no latency between compressed and image_raw.

I am wondering what causes this. Does theora get processed on the computer or is this a driver/setup related issue?

I was unable to find a good answer online for this so I am hoping someone could clarify this.

Thank you

EDIT: Clarification

edit retag close merge delete

You question is not clear: your first paragraph says theora has low latency, and your 2nd implies it has high latency.

( 2022-04-15 12:45:44 -0500 )edit

Sorry if I was unclear i will edit the post, There IS latency between theora and image_raw, there is no or little latency between compressed and image_raw

( 2022-04-15 12:58:02 -0500 )edit
1

I'm not seeing a good reference right now but theora is compressing the images a lot more aggressively than the regular compressed so takes more time to do it, and is very probably looking at multiple frames in a sequence for better compression so always is more behind. Regular compressed is doing jpeg or png compression on a single frame but won't take advantage of a series of images that are mostly the same.

Take a look at https://github.com/daniilidis-group/f..., which is similar high compression and definitly looking at multiple frames so will have latency, but maybe less than theora (also depending on configuration)- possibly ffmpeg is better optimized than theora compression because it is so much more widely used.

( 2022-04-17 10:49:36 -0500 )edit

Thank you, this certainly makes sense.

( 2022-04-17 17:09:30 -0500 )edit

Sort by » oldest newest most voted

I agree with @lucasw. theora is a video codec, and the default config for these codecs tend to prioritize image quality over low latency. I have not used this theora plugin, but have used other similar video codecs.

If you want smaller end-to-end latency, try this: use keyframes more often, use variable bitrate, and use worse image quality (note: the wiki doesn't tell us if that means you should configure a higher or lower numeric value; usually it's a higher numeric value.)

http://wiki.ros.org/theora_image_tran...

Just be aware that, in terms of end-to-end latency with compression, you are unlikely to do better than compressed_image_transport.

more

Thank you, I suppose that I don't really have a need for using theora at the moment but I'll look into this.

( 2022-04-17 17:10:42 -0500 )edit