-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support image_transport in rosimagesink #66
Comments
Image_transport is an extremely welcome addition I didn't use image_transport in the original plugins because I thought it would be more efficient to allow gstreamer to handle encoding and decoding. That turned out to be wildly impractical to integrate with image_transport. I'd like to see image_transport take over the majority of uses, but composable_nodes (on the It might be reasonable to use the original image_sink as a base class, and have two derived classed for each of image_transport::publisher, and image_transport::camera_publisher. I can't find where the ffmpeg encoding string is used, how does that get picked up by the compression mechanism? |
Thanks for your feedback! I originally hacked together above implementation for my specific use case, where I want subscribers to be able to choose at runtime in which format they want to receive images published by a GStreamer/DeepStream pipeline. Your suggestion of keeping the original image_sink as a base class and deriving from that makes perfect sense to me. I haven't looked into image_transport::camera_publisher yet, but I assume this is related to #49 and involves exposing As for the ffmpeg encoding string: Regarding the dependencies: In the coming days/weeks, I will probably implement your suggestions and think about different ways to configure ffmpeg-image-transport. |
I suppose camera_info_manager would be the correct helper class to use, I haven't had to look into it before, but yes it would need a camera_info url property, and maybe even individual lens properties, let's discuss that in #49
Amazing! That deserves proper support. Gstreamer has very many platform specific h264 encoders which are more efficient than anything ffmpeg can offer on embedded systems. The rpicamsrc in particular allows the raspi zero to transmit beautiful compressed h264 video, but you must compress before it leaves the GPU because the CPU can't compress the feed, and there's not enough memory bandwidth to pass raw frames back to the GPU. The CompressedVideo message type should have a sink node that packages buffers from h264parse. That allows you to use any up-stream video compression element that suits the hardware, and even re-payload and forward compressed binary data received over other transports. The Parameter plugin already allows the raspberry zero h264 compression bitrate to be changed remotely on the fly as a ros parameter. If there's a new ros parameter convention or api that image_transport expects, it might deserve a dedicated pipeline plugin to make the api transparent into gstreamer. I would like to work with Foxglove to make webrtc easier to use in fleet robots, and use the data_channels as a telemetry bridge. The image_transport sink is still worthwhile, and seems like low-hanging fruit |
@BrettRD I would be interested in creating a h264 image sink. It would probably suffice to copy the image sink, modify it to extract the binary stream and package it in the Foxglove compressed video message, right? |
I believe support for image_transport could be a great addition to rosimagesink (or a new plugin). image_transport allows using different formats / encodings for the published images, in a way that's transparent to the publisher. The publisher publishes standard ImageMsgs which are encoded on-demand by the available image_transport plugins. This allows to easily offer images encoded as Image, CompressedImage, theora, h264 or h265 (via ffmpeg-image-transport, which also supports hardware encoding via nvenc) from a single rosimagesink. Images are only encoded to the respective formats if there's at least one subscriber requesting that format, which means there's no unnecessary overhead for offering multiple formats.
I went ahead and implemented a basic version by creating a new plugin based on rosimagesink and using image_transport for the publisher: https://github.com/fa-se/ros-gst-bridge/tree/imagetransport_sink
Is support for image_transport something you've been considering? I could polish my implementation a bit and open a pull request - I just wanted to get some feedback on the idea first.
The text was updated successfully, but these errors were encountered: