OpenCV Error: Unspecified error (GStreamer: unable to start pipeline

I tried the YOLO model and I’ve got some errors.

I don’t know how to resolve it.

cae@cae-desktop:~/opencv/opencv-3.4.0/build/darknet$ ./darknet detector demo data/obj.data yolo-obj.cfg /home/cae/opencv/opencv-3.4.0/build/darknet/backup/yolo-obj_20000.weights -c 2

Demo

layer filters size input output 0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BFLOPs

1 max 2 x 2 / 2 416 x 416 x 32 -> 208 x 208 x 32
2 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64 1.595 BFLOPs
3 max 2 x 2 / 2 208 x 208 x 64 -> 104 x 104 x 64
4 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BFLOPs
5 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BFLOPs
6 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BFLOPs
7 max 2 x 2 / 2 104 x 104 x 128 -> 52 x 52 x 128
8 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BFLOPs
9 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BFLOPs
10 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BFLOPs

11 max 2 x 2 / 2 52 x 52 x 256 -> 26 x 26 x 256 12 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs

13 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BFLOPs

14 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs

15 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BFLOPs

16 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs

17 max 2 x 2 / 2 26 x 26 x 512 -> 13 x 13 x 512 18 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs

19 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BFLOPs

20 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs

21 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BFLOPs

22 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs

23 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BFLOPs

24 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BFLOPs

25 route 16 26 reorg / 2 26 x 26 x 512 -> 13 x 13 x2048 27 route 26 24 28 conv 1024 3 x 3 / 1 13 x 13 x3072 -> 13 x 13 x1024 9.569 BFLOPs

29 conv 40 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 40 0.014 BFLOPs

30 detection mask_scale: Using default ‘1.000000’ Loading weights from /home/cae/opencv/opencv-3.4.0/build/darknet/backup/yolo-obj_20000.weights…Done! VIDEOIO ERROR: V4L: index 2 is not correct!

(darknet:25906): GLib-GObject-WARNING **: 17:28:14.637: cannot register existing type ‘GstInterpolationMethod’

(darknet:25906): GLib-GObject-CRITICAL **: 17:28:14.641: g_param_spec_enum: assertion ‘G_TYPE_IS_ENUM (enum_type)’ failed

(darknet:25906): GLib-GObject-CRITICAL **: 17:28:14.641: validate_pspec_to_install: assertion ‘G_IS_PARAM_SPEC (pspec)’ failed OpenCV Error: Unspecified error (GStreamer: unable to start pipeline ) in cvCaptureFromCAM_GStreamer, file /home/nvidia/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp, line 887 VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast(index))): raised OpenCV exception:

/home/nvidia/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp:887: error: (-2) GStreamer: unable to start pipeline in function cvCaptureFromCAM_GStreamer

Couldn’t connect to webcam. : Inappropriate ioctl for device darknet: ./src/utils.c:256: error: Assertion `0’ failed. Aborted (core dumped)

Hi,
Please share which sample you run. Not sure but it seems like you are running a sample from OpenCV package.