Cannot run gstreamer pipeline in opencv

I am trying to stream video from laptop camera using ksvideosrc and then process it using appsink . It does not run and throws error

My Pipeline - VideoCapture cap(“-v ksvideosrc do-stats=TRUE ! videoconvert ! video/x-raw, format=BGR ! videoconvert ! appsink”, CAP_GSTREAMER);

Error observed on console -
[ WARN:0@0.073] global C:\OpenCV-4.6.0_New\opencv\sources\modules\videoio\src\cap_gstreamer.cpp (1127) cv::GStreamerCapture::open OpenCV | GStreamer warning: Error opening bin: no element “X”
[ WARN:0@0.074] global C:\OpenCV-4.6.0_New\opencv\sources\modules\videoio\src\cap_gstreamer.cpp (862) cv::GStreamerCapture::isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Empty Frame … Could not read Camera!

Note - My camera starts for 1 sec and then shuts off (No video observed) in Release mode and application doesnt with above error in Debug mode
Can you please help ?

please, no images of code or errors anywhere. please remove, and post TEXT, thank you

As per your suggestion changed my question

1 Like