-
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
Setting caps on rosimagesrc from ROS Image msg #47
Comments
I noticed the error now..my GStreamer pipeline is initialized and playing BEFORE the caps are set on the rosimagesrc element (i.e. the rosimagesrc_fixate function call). This is the reason for the error. However, the broader question of supporting video resolutions changing on-the-fly still applies I think. |
Thanks for the interest, this is a known limitation. The errors you're seeing are printed where a gstreamer re-negotiate hook should be. If you can track down an example of a change-of-format hook, I'd love to get this feature implemented. |
I think GStreamer dynamic pipelines are what we need. A pad added callback which updates the caps based on incoming buffers. https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c I'll try to make a minimal example and share here. |
I thought dynamic pipelines were a different thing, anything that is triggered at pipeline level can't be driven by the bridge nodes and can't happen under gst-launch I certainly want to add dynamic pipelines to the pipeline node so that you can reconfigure the pipeline on a remote host from a ros param update callback, but that's a separate thing. caps renegotiation can be triggered by an element under gst-launch |
Hi @BrettRD, you are right! I looked into this a bit: we can add a data probe on the sink pad of rosimagesrc and then in the callback access the caps from the incoming message, something like this:
All this is well and good, but the issue is that rosimagesrc is not of type GstElement. I haven't completely understood the abstraction with klass to figure out how the wrapper works. Perhaps you could help me out here? |
Thanks for looking that up! There is a threading/locking bug in The klass wrapper is pointer magic; the first member of a klass is at the same pointer as the klass. You can simply cast the
use the macros for clarity though: |
HI @BrettRD,
I noticed that the rosimagesrc element caps are not reading correctly the height, width etc. from the ROS Image.msg and need to be be set explicitly during pipeline initialization.
Excerpt of the logs that show the issue:
I noticed that the function rosimagesrc_fixate does not actually pick the caps from ROS.
I tried running the ROS image publisher before starting the node containing rosimagesrc just to check if the latter takes the video parameters from ROS and found that it does not.
Have you tried setting the caps from the ROS message?
The text was updated successfully, but these errors were encountered: