uri 警告中缺少端口:使用 Python OpenCV cv2.VideoCapture() 打开文件时出错 [英] Port missing in uri warning: Error opening file with Python OpenCV cv2.VideoCapture()
本文介绍了uri 警告中缺少端口:使用 Python OpenCV cv2.VideoCapture() 打开文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试流式传输 ipcam 时,我遇到了如下所示的错误
I got a blunder as depicted beneath when I endeavor to stream ipcam
"[tcp @ 000000000048c640] uri 中缺少端口警告:打开文件时出错 (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)"
"[tcp @ 000000000048c640] Port missing in uri warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)"
import numpy as np
import cv2
cv2.__file__
cap = cv2.VideoCapture('http://admin:password@http://192.168.1.***/')
#cap = cv2.VideoCapture('https://www.youtube.com/watch?v=Mus_vwhTCq0')
while(True):
ret, frame = cap.read()
try:
cv2.resizeWindow('Stream IP Camera OpenCV', 120300, 800)
cv2.imshow('Stream IP Camera OpenCV',frame)
except Exception as ex:
template = "An exception of type {0} occurred. Arguments:\n{1!r}"
message = template.format(type(ex).__name__, ex.args)
print (message)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
推荐答案
从使 url 在 VLC 中工作开始.尝试 本网站 以获得适用于您的相机的有效链接/端口/用户/密码组合.
Start with making the url working in VLC. Try this website to get a working link/port/user/password combination that works for you camera.
这篇关于uri 警告中缺少端口:使用 Python OpenCV cv2.VideoCapture() 打开文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文