Open keniee opened 4 months ago
Thanks for the PR! I though offsets were possible using an upstream element to adjust the buffer timestamp, but I must have been imagining things.
The new prop looks good, I'm happy to include it with a few tweaks:
The offset is conditionally set according to its sign and can only move the timestamp into the future, but it seems desirable to be able to shift a timestamp into the recent past using a negative value.
This prop doesn't work on ros_audio_sink.
If you were to apply the timestamp in the render method of rosbasesink, it will correctly inherit to all of the other ros*sink types. Try leaving the rosimagesink unmodified and simply add the time offset over here
Thanks again!
This feature enables an offset time specified in nanoseconds to modify the timestamp of the published ros image topic. A parameter ros-time-offset is added as a specifier to rosimagesink.
Usage Example adds 10s to the current timestamp of a published image:
gst-launch-1.0 videotestsrc pattern=ball ! video/x-raw, format=RGB,width=1280,height=720 ! timeoverlay ! queue ! rosimagesink ros-topic=test/image ros-name='gst_rosimagesink_camera' ros-namespace='gst' ros-frame-id='camera_frame' ros-time-offset=10000000000 throttle-time=0