a question about VideoWriter and gstreamer

I want to use gstreamer to encode videos in opencv, since gstreamer has the potential to hardware-encode. I’ve written the following code with c++.

cv::VideoCapture video_cap;
std::string gstr = "appsrc ! autovideoconvert ! omxh264enc ! matroskamux ! filesink location=test.avi sync=false";

video_writer.open(gstr, CV_FOURCC('M','J','P','G'), fps, cv::Size(width, height), true);

Everything works fine. I can get the final file “test.avi”. However, I’m a little bit confused about the code above.
In the gstr, “omxh264enc” is used, which means the video encoder is h264.
In the vider_writer, CV_FOUR(‘M’,‘J’,‘P’,‘G’) is used, which represents that “motion jpeg” video encoder is activated.
Therefore, I’m curious which video encoder is used.

Thanks in advance.

Hi,
You can check what elements are used by exporting GST_DEBUG:

$ export GST_DEBUG=*FACTORY*:4

Not sure how OpenCV video_writer chooses video encoder. Other users may share more information on this.