-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
BGRx format in the VideoCapture's gstreamer integration #11059
Copy link
Copy link
Closed
Labels
Milestone
Description
System information (version)
- OpenCV => 3.4.1
- Operating System / Platform => Linux Arm64
- Compiler => gcc 5
Detailed description
The gstreamer will return a vague error message OpenCV(3.4.1) Error: Unspecified error (GStreamer: unable to start pipeline when used the BGRx format. From the source code it is clear why this happens:
opencv/modules/videoio/src/cap_gstreamer.cpp
Lines 321 to 323 in 6ffc487
| // we support 11 types of data: | |
| // video/x-raw, format=BGR -> 8bit, 3 channels | |
| // video/x-raw, format=GRAY8 -> 8bit, 1 channel |
But these code comments are not accessible anywhere out of source code. And for the fourcc code, BGRx is more nature than BGR(at least for me)
Could we either
- add these comments to public document
- support BGRx in addition to BGR format?
Also, could we add an early error message if the format is not supported. For now, it didn't do anything if a unsupported format is present and it cause random error in later stage.
Steps to reproduce
import cv2
pipeline='v4l2src device=/dev/video1 ! video/x-raw,width=640,height=480,format=I420,framerate=30/1 ! videoconvert ! video/x-raw,width=640,height=480,format=BGRx ! appsink'
cap=cv2.VideoCapture(pipeline, cv2.CAP_GSTREAMER)Error:
OpenCV(3.4.1) Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/nvidia/tmp/opencv/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename)): raised OpenCV exception:
OpenCV(3.4.1) /home/nvidia/tmp/opencv/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
in function cvCaptureFromCAM_GStreamer
Reactions are currently unavailable