微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

读rtsp时Ubuntu OpenCV错误

如何解决读rtsp时Ubuntu OpenCV错误

系统信息(版本)

OpenCV = 4.4.0

操作系统/平台= Ubuntu

编译器= Python 3.6.9

使用RTSP读取视频流时出现编码错误,如下所示。最初,读取过程开始,运行时显示错误

[hevc @ 0x83b9940] Could not find ref with POC 0

[rtsp @ 0x8325a00] RTP: PT=60: bad cseq ced0 expected=c18a

[rtsp @ 0x8325a00] RTP: PT=60: bad cseq de79 expected=d168

[hevc @ 0x83aefc0] The cu_qp_delta 64 is outside the valid range [-26,25].

[hevc @ 0x83b9940] Could not find ref with POC 8

[hevc @ 0x83aefc0] CABAC_MAX_BIN : 7

[hevc @ 0x83aefc0] The cu_qp_delta 1094995529 is outside the valid range [-26,25].

[hevc @ 0x83a05c0] The cu_qp_delta -59 is outside the valid range [-26,25].

[hevc @ 0x833aa00] The cu_qp_delta 35 is outside the valid range [-26,25].

代码如下所示

cap = cv2.VideoCapture("rtsp://********@192.168.0.46:33/Streaming/Channels/101",cv2.CAP_FFMPEG) 
cap.set(cv2.CAP_PROP_FPS,3)
if (cap.isOpened()== False):  
    print("Error opening the file")
prevIoUs_face = None
# Read until video is completed 
while(cap.isOpened()):  # Capture frame-by-frame 
    ret,frame = cap.read()
    if(np.shape(frame) != ()):
        frame = cv2.resize(frame,(780,540),interpolation=cv2.INTER_AREA)
        cv2.imshow('video',frame)

我们尝试使用nohup来连续运行它。该代码开始成功运行,并且可以正确读取流,但是在短时间(不是在指定的时间间隔内)后,该错误被抛出,并且and停止运行。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。