【发布时间】:2022-08-02 18:45:42
【问题描述】:
您好,我是 opencv 的初学者,我正在尝试通过 HIKVISION IP 摄像头创建实时对象检测程序。使用 RTSP 但当我运行代码时出现此错误
ip_add 就像rtsp://login:password@ip_address:554/streaming/channels/101
cap = cv2.VideoCapture(Ip_add, cv2.CAP_FFMPEG)
while True:
_, frame = cap.read()
frame = cv2.resize(frame, dsize=(1400, 600))
(class_ids, scores, bboxes) = model.detect(frame)
for class_id, score, bbox in zip(class_ids, scores, bboxes):
(x, y, w, h) = bbox
cv2.putText(frame, classes[class_id], (x, y - 10), cv2.FONT_HERSHEY_PLAIN, 2,(200, 0, 50),2)
cv2.rectangle(frame, (x, y), (x + w, y + h), (200, 0, 50), 2)
cv2.imshow(\"IP Camera\", frame)
if cv2.waitKey(1) == ord(\"q\"):
break
cap.release()
cv2.destroyAllWindows()
有人可以帮帮我吗 ?
-
对不起...这是我得到的错误:[h264 @ 0000021c7162b0c0] 不存在的 PPS 0 引用 [h264 @ 0000021c7162b0c0] 不存在的 PPS 0 引用 [h264 @ 0000021c7162b0c0] decode_slice_header 错误 [h264 @ 000000021c 帧! [h264 @ 0000021c7162b0c0] 引用了不存在的 PPS 0 [h264 @ 0000021c7162b0c0] 引用了不存在的 PPS 0 [h264 @ 0000021c7162b0c0] decode_slice_header 错误 [h264 @ 0000021c7162b0c0] 没有帧!
-
它可以与 FFplay(shell 命令)一起使用吗?
ffplay rtsp://login:password@ip_address:554/streaming/channels/101