0

Using gstreamer on the jetson nano board, I display rtsp stream, My pipe on terminal is as follows:

gst-launch-1.0 rtspsrc location='rtsp://user:password...' sync=false latency=5 ! decodebin ! nvvidconv ! xvimagesink

And everything is fine.

I installed opencv from source and compiled it with cuda nad gstreamer capabilities, but when I run it in the following code snippet, the camera does not load:

cv::VideoCapture cap("rtspsrc location=rtsp://user:password... sync=false latency=5 ! decodebin ! nvvidconv ! xvimagesink",cv::CAP_GSTREAMER);

error is :

[WARN:0] global /home/kamiz/opencv/modules/videoio/src/cap_gstreamer.cpp (944) 
open OpenCV | GStreamer warning: cannot find appsink in manual pipeline 
[WARN:0] global /home/kamiz/opencv/modules/videoio/src/cap_gstreamer.cpp (597)
isPiplelinePlaying Opencv | GStreamer warning: pipeline have not been created 
ERROR: unable to open camera 
nvdc: start nvdcEventThread
nvdc: exit nvdcEventThread

This is while I display the usb camera in opencv with gstreamer without any problems. Thank you in advance for your help

  • What is xvimagesink? afair you will need to convert to BGR and nvvidconv maybe only supports RGB? And according to the error message you need an appsink ;) – Micka Dec 05 '21 at 19:22
  • https://answers.opencv.org/question/119583/how-does-the-cv2videocapture-class-work-with-gstreamer-pipelines/ – Micka Dec 05 '21 at 19:28
  • Thank you for your help But when I use appsink instead of xvimagesink I have this error: opening in BLOCKING MODE .... unable to query duration of stream ... cannot query video position: status=1 ,value=2,duration=1 ... setProperty OpenCV | GStreamer warning: unhandled property – faridsds Dec 06 '21 at 05:49
  • can you try `! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink`? – Micka Dec 06 '21 at 07:34
  • hi, thank you. I did this, but I got exactly the same error as before – faridsds Dec 07 '21 at 09:14
  • ok sorry, then I dont know. What's the gstreamer command with which you get the stream running in the terminal? Maybe you find more information about this error in SO or google? `opening in BLOCKING MODE .... unable to query duration of stream ... cannot query video position: status=1 ,value=2,duration=1 ... setProperty OpenCV | GStreamer warning: unhandled property` – Micka Dec 07 '21 at 10:34
  • https://github.com/TheImagingSource/tiscamera/issues/332 `encountered the exact same error and the problem turned out to be conflicting opencv installs. I had 4.3 installed on arch linux through pacman while my project was using opencv 4.2 from pip. Uninstalling 4.3 with pacman solved the issue for me.` – Micka Dec 07 '21 at 10:37

0 Answers0