RTSP Streaming to MediaMtx server allowing BGR and BGRA

Hi,
I have a C# app using EmguCv compiled to user Gstreamer.
I’m using this to write frames using OpenCv VideoWriter to RTSP server.

This is my VideoWriter pipeline

appsrc is-live=true do-timestamp=true
 ! videoconvert
 ! qsvh264enc bitrate=10000 low-latency=true target-usage=7
 ! h264parse 
 ! rtspclientsink location=rtsp://localhost:8554/rgbStream

I have discovered that this is working well when OpenCv frames are in BGR color space but If I write frames are in BGRA color space the VideoWriter is failing.
Is there any way to support both BGR and BGRA frames in the same pipeline to let gstreamer manage it in the correct way?

With regards,

Normally with appsrc you need to specify the caps. Gstreamer doesn’t know what format you are pushing. Try adding “video/x-raw, format=BGRA” before your videoconvert element.

It didn’t work for me that fix. What I wanted to know if it’s possible to make the pipeline allow both color spaces, BGR and BGRA.

With regards,