CircusMonkey / ros_rtsp

ROS node to subscribe to an image and serve it up as a RTSP video feed.
The Unlicense
103 stars 48 forks source link

Synchronization and timestamping problem #6

Open zizo1111 opened 3 years ago

zizo1111 commented 3 years ago

Hi, Thanks for the great work.

I am currently using the node to stream ros images which i later receive as rtsp stream in gstreamer. for my use case the timestamps from the ros images are very important, after a bit of digging i found that neither the server pipeline clock is synced with images timestamps, nor the timestamps are attached to the buffer as metadata.

thanks in advance

CircusMonkey commented 3 years ago

Hi zizo1111, for this use case the main priority was low latency and so anything that could adversely affect the latency was not considered. Timestamping could probably be introduced without any concern however I will leave it up to you if you need it.

zizo1111 commented 3 years ago

Hi, thanks for the reply, i am willing to do it, can you possibly provide me with some guidance where to start, or some ideas. I have tried to attach a metadata buffer to the rtsp stream, but it always get dropped.

mtbsteve commented 3 years ago

@zizo1111 not sure what your problem exactly is, but I had some issues that the video feed on my Android devices was broken up and only maybe 10% of the video was displayed. So I added to force SPS/PPS config frames in the stream by including
! omxh264enc insert-sps-pps=1 ! to the gstreamer pipeline on the ros_rtsp server code. With that, the ros_rtsp server works like a charm on all my devices with all my video nodes. Maybe that helps.

zizo1111 commented 3 years ago

@mtbsteve , I am trying to preserve the ros timestamps of the source images through the gstreamer pipeline, so i can use these timestamps later on the client side.