From 715f23127cb231d7ec7417b18fad2d77b493139e Mon Sep 17 00:00:00 2001 From: zarelaky Date: Mon, 6 Aug 2018 22:11:23 +0800 Subject: [PATCH] Update cap_gstreamer.cpp fixed call open(int id) failed --- modules/videoio/src/cap_gstreamer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/videoio/src/cap_gstreamer.cpp b/modules/videoio/src/cap_gstreamer.cpp index 8758b21dd9..2c9570e67f 100644 --- a/modules/videoio/src/cap_gstreamer.cpp +++ b/modules/videoio/src/cap_gstreamer.cpp @@ -613,10 +613,12 @@ int GStreamerCapture::getCaptureDomain() { return CAP_GSTREAMER; } */ bool GStreamerCapture::open(int id) { + gst_initializer::init(); + if (!is_gst_element_exists("v4l2src")) return false; std::ostringstream desc; - desc << "v4l2src device-name=/dev/video" << id + desc << "v4l2src device=/dev/video" << id << " ! " << COLOR_ELEM << " ! appsink"; return open(desc.str());