Repository: opencv
Issue: VideoCapture GStreamer backend does not support CAP_PROP_FORMAT property
Labels: feature,priority: low,category: videoio

##### System information (version)

- OpenCV => 4.2.0
- Operating System / Platform => Debian GNU/Linux

##### Detailed description

Hi,

I noticed that the VideoCapture GStreamer backend does not support the `CAP_PROP_FORMAT` property.

I get the following message when I try to call `inputVideo.get(cv::CAP_PROP_FORMAT)`:
```
$ ./gstreamer_cap_prop_format 
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (1036) getProperty OpenCV | GStreamer warning: unhandled property: 8
```

The problem does not occur with the `V4L2` backend, but I would prefer not to specify the backend explicitly in the code.

##### Steps to reproduce

Here is a minimal test to reproduce the issue:

```.cpp
// c++ -o gstreamer_cap_prop_format $(pkg-config --cflags opencv4) gstreamer_cap_prop_format.cpp $(pkg-config --libs opencv4)

#include <opencv2/opencv.hpp>

int main(void)
{
	cv::VideoCapture inputVideo;
	cv::Size frame_size;

#if 0
	inputVideo.open(0, cv::CAP_V4L2);
#else
	inputVideo.open(0, cv::CAP_GSTREAMER);
#endif
	if (!inputVideo.isOpened()) {
		std::cerr  << "Could not open the input video source." << std::endl;
		return -1;
	}

	frame_size = cv::Size((int) inputVideo.get(cv::CAP_PROP_FRAME_WIDTH),
			      (int) inputVideo.get(cv::CAP_PROP_FRAME_HEIGHT));

	cv::Mat dummy_frame(frame_size, inputVideo.get(cv::CAP_PROP_FORMAT));

	return 0;
}
```

##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with answers.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       answers.opencv.org, Stack Overflow, etc and have not found solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://answers.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I ~updated to~ checked the latest OpenCV version and the issue is still there: https://github.com/opencv/opencv/blob/1b443219ed181124978ed8627fb2da8db42765ab/modules/videoio/src/cap_gstreamer.cpp#L959
   
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only latest release for each branch.
   The ticket is closed, if the problem is not reproduced with modern version.
   -->
 - [x] There is reproducer code
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as archive to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->