[英]Python OpenCV VideoCapturing problem from IP camera..error:(-5:Bad argument) CAP_IMAGES: can't find starting number
I am trying to enable this IP cam that I have access to its feed by the browser.我正在尝试启用这个 IP cam,我可以通过浏览器访问它的提要。 but can't access it through a python project to do some object detection stuff.但无法通过 python 项目访问它来做一些 object 检测工作。 but I can't seem to get the feed to be cv2.videocapture()
ed without an error.但我似乎无法让提要被cv2.videocapture()
编辑而没有错误。 the link to the camera feed is live and working.指向摄像机源的链接是实时的并且可以工作。 the capturing code in the main pythin file: pythin 主文件中的捕获代码:
vs = cv2.VideoCapture('http://<user>:<pass>@<IP>:8080/video.cgi?.mjpg')
I have tried to put rtsp also but no use and I get this error in the cmd when I run the program by command: anything not in <> is exactly how I entered it我也尝试输入 rtsp 但没有用,当我通过命令运行程序时,我在 cmd 中收到此错误:<> 中没有的任何内容正是我输入的方式
[tcp @ 000001f40de13980] Connection to tcp://<IP>:8080 failed: Error number -138 occurred
[ERROR:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap.cpp (116) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): http://<user>:<pass>@<IP>:8080/video.cgi?.mjpg in function 'cv::icvExtractPattern'
Videocapture(0)
流式笔记本电脑摄像头工作Videocapture(0)
please explain your answer since I'm new and thanks.请解释你的答案,因为我是新手,谢谢。
import cv2
cam = cv2.VideoCapture('rtsp://admin:admin@10.10.1.38/H264?ch=1&subtype=0')
ret, im =cam.read()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.