{
  "id": "opencv/video-capture-gstreamer-pipeline-failed",
  "signature": "cv2.error: OpenCV(4.8.0) /modules/videoio/src/cap_gstreamer.cpp:1058: error: (-215:Assertion failed) gst_pipeline is NULL in function 'CvCapture_GStreamer::open'",
  "signature_zh": "cv2.error: OpenCV(4.8.0) /modules/videoio/src/cap_gstreamer.cpp:1058: error: (-215:断言失败) gst_pipeline 为空 在函数 'CvCapture_GStreamer::open' 中",
  "regex": "cv2\\.error: OpenCV\\([\\d.]+\\).*cap_gstreamer\\.cpp:\\d+: error: \\(-215:Assertion failed\\) gst_pipeline is NULL",
  "domain": "opencv",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The GStreamer pipeline string passed to VideoCapture is invalid or GStreamer is not properly initialized.",
  "root_cause_type": "generic",
  "root_cause_zh": "传递给 VideoCapture 的 GStreamer 管道字符串无效，或 GStreamer 未正确初始化。",
  "versions": [
    {
      "version": "4.5.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If OpenCV is built without GStreamer backend, the error changes; this error specifically occurs when GStreamer is present but pipeline fails.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "For RTSP or network streams, a file path won't work; the pipeline must be correctly formatted.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Missing plugins (e.g., 'videotestsrc') cause pipeline construction to fail silently; the error is not just about syntax.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink\n# If this works, adapt the same pipeline string for OpenCV:\ncap = cv2.VideoCapture('videotestsrc ! videoconvert ! appsink', cv2.CAP_GSTREAMER)",
      "success_rate": 0.85,
      "how": "gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink\n# If this works, adapt the same pipeline string for OpenCV:\ncap = cv2.VideoCapture('videotestsrc ! videoconvert ! appsink', cv2.CAP_GSTREAMER)",
      "condition": "",
      "sources": []
    },
    {
      "action": "cap = cv2.VideoCapture('rtspsrc location=rtsp://example.com/stream ! decodebin ! videoconvert ! appsink', cv2.CAP_GSTREAMER)",
      "success_rate": 0.8,
      "how": "cap = cv2.VideoCapture('rtspsrc location=rtsp://example.com/stream ! decodebin ! videoconvert ! appsink', cv2.CAP_GSTREAMER)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink\n# If this works, adapt the same pipeline string for OpenCV:\ncap = cv2.VideoCapture('videotestsrc ! videoconvert ! appsink', cv2.CAP_GSTREAMER)",
    "cap = cv2.VideoCapture('rtspsrc location=rtsp://example.com/stream ! decodebin ! videoconvert ! appsink', cv2.CAP_GSTREAMER)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.opencv.org/4.x/dd/d43/tutorial_gstreamer.html",
  "official_doc_section": null,
  "error_code": "-215",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "partial",
  "first_seen": "2024-08-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}