here is my cpp code:
cv::VideoCapture captureVideoInLabel;
captureVideoInLabel.open("imxv4l2videosrc device=/dev/video0 ! imxiputransform ! video/x-raw,format=BGR,width=720,height=576,framerate=25/1 ! appsink", cv::CAP_GSTREAMER);
with BGRA format gst-launch-1.0 works fine but opencv doesnt support BGRA, just support BGR.