On a project, I need to get through a gstreamer pipeline the feed from a 4k camera and send it to the appsink for further processing. We get the feed in I420 format then we need to convert it to BGR in order to get it to the appsink, but I ran into several issues. My first command was the following :
cv::VideoCapture("v4l2src device=/dev/video1 ! video/x-raw, width=(int)3840, height=(int)2160,format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw(memory:NVMM), format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")
debug says videoconvert0 cannot link to appsink0, but I don’t understand why the BGR is not supported as it should be. I tried several other combinations to no avail.
Maybe videoconvert is failing somewhere, in addition I would rather have everything handled by the GPU (I think videoconvert is CPU processing) so I heard about nvivafilter but it only supports nv12 and RGBA. Is it possible to add the BGR format to the cuda process (using nvsample_cudaprocess)?