Bayer format issue while flipping image

Hi, this is a pretty long question so bear with me. I have a lucid vision lab camera TRI023S-C and I am trying to flip the image by setting ReverseY=true in the gst pipeline. When i set ReverseY=true the PixelFormat of the camera changes from the default BayerRG8 to BayerBG8. The issue is aravissrc is not able to negotiate the correct bayer format when i run the gst pipeline for the first time.

user@user-p51:~$ GST_DEBUG=3 gst-launch-1.0 aravissrc features=“ReverseY=true PixelFormat=BayerGB8” ! video/x-bayer,format=gbrg,width=1920,height=1080,framerate=30/1 ! bayer2rgb ! videoconvert ! autovideosink
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
0:00:00.535290079 29856 0xeb6a30 FIXME default gstutils.c:3766:gst_pad_create_stream_id_internal:aravis0:src Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.535505914 29856 0xeb6a30 WARN basesrc gstbasesrc.c:2948:gst_base_src_loop: error: Internal data flow error.
0:00:00.535525724 29856 0xeb6a30 WARN basesrc gstbasesrc.c:2948:gst_base_src_loop: error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstAravis:aravis0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstAravis:aravis0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

I have to set the bayer format to rggb initially to get the video feed with a pipeline like this (and of course this gives me weird colors due to incorrect debayering)

gst-launch-1.0 aravissrc features=“ReverseY=true PixelFormat=BayerGB8” ! video/x-bayer,format=rggb,width=1920,height=1080,framerate=30/1 ! bayer2rgb ! videoconvert ! autovideosink

Once i run the above pipeline, now i can set the correct bayer format and i get the desired video feed with correct debayering

gst-launch-1.0 aravissrc features=“ReverseY=true PixelFormat=BayerGB8” ! video/x-bayer,format=gbrg,width=1920,height=1080,framerate=30/1 ! bayer2rgb ! videoconvert ! autovideosink

Any idea how to fix this?

Sorry for the (very) late reply.

The issue is pixel format is configured before the features parameter is applied in gst_aravis_set_caps:

The order should be inverted.

Please open an issue on github.