Ask Your Question

Revision history [back]

centos7 cv2 VideoWrite error!

OpenCV Error: Unspecified error (GStreamer: cannot link elements ) in CvVideoWriter_GStreamer::open, file /data/opencv-3.2.0/modules/videoio/src/cap_gstreamer.cpp, line 1492 VIDEOIO(cvCreateVideoWriter_GStreamer(filename, fourcc, fps, frameSize, is_color)): raised OpenCV exception:

/data/opencv-3.2.0/modules/videoio/src/cap_gstreamer.cpp:1492: error: (-2) GStreamer: cannot link elements in function CvVideoWriter_GStreamer::open

my code:

```

coding: utf-8

import numpy as np import cv2 import base64

fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter("avi_file.avi", fourcc, 24, (307, 568)) for i in range(0, 45): img12 = cv2.imread('/data/zgsee/opencv/img/{}.jpg'.format(i)) out.write(img12) out.release() ```

click to hide/show revision 2
No.2 Revision

updated 2017-07-10 02:37:39 -0600

berak gravatar image

centos7 cv2 VideoWrite error!

OpenCV Error: Unspecified error (GStreamer: cannot link elements ) in CvVideoWriter_GStreamer::open, file /data/opencv-3.2.0/modules/videoio/src/cap_gstreamer.cpp, line 1492 VIDEOIO(cvCreateVideoWriter_GStreamer(filename, fourcc, fps, frameSize, is_color)): raised OpenCV exception:

/data/opencv-3.2.0/modules/videoio/src/cap_gstreamer.cpp:1492: error: (-2) GStreamer: cannot link elements in function CvVideoWriter_GStreamer::open

my code:

```

# coding: utf-8

utf-8

import numpy as np import cv2 import base64

base64

fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter("avi_file.avi", fourcc, 24, (307, 568)) for i in range(0, 45): img12 = cv2.imread('/data/zgsee/opencv/img/{}.jpg'.format(i)) out.write(img12) out.release()

```