We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我使用网络摄像头的rtsp获取视频流用cpu进行推理,推理的命令为python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_pphuman.yml --rtsp rtsp://admin:[email protected] --device=cpu 这里的rstp是我自己的网络摄像头的信息,在用人员行为识别检测的时候,跑了50帧左右就自动结束了,之后我加了一些日志代码 def capturevideo(self, capture, queue): frame_id = 0 logging.info("开始捕获视频流") while (1): if queue.full(): time.sleep(0.1) else: ret, frame = capture.read() if not ret: err_code = capture.get(cv2.CAP_PROP_POS_MSEC) logging.error(f"无法从视频流中读取帧,错误代码:{err_code}") # 检查是否到达视频流的末尾 if err_code == 0: logging.error("可能已到达视频流的末尾") else: logging.error("视频流读取错误,可能是网络问题或视频源问题") break # 或者根据需要处理错误 frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) queue.put(frame_rgb) logging.debug(f"成功读取帧 {frame_id}") frame_id += 1 发现最后会报"可能已到达视频流的末尾"这行字,然后视频会正常保存,所以这是程序的问题还是摄像头的问题呢?
The text was updated successfully, but these errors were encountered:
cpu推理比较慢,会导致丢帧或者爆显存的问题,建议确认一下cpu上每帧推理的时间,根据这个时间进行抽帧预测
Sorry, something went wrong.
lyuwenyu
leo-q8
No branches or pull requests
问题确认 Search before asking
请提出你的问题 Please ask your question
我使用网络摄像头的rtsp获取视频流用cpu进行推理,推理的命令为python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_pphuman.yml --rtsp rtsp://admin:[email protected] --device=cpu
这里的rstp是我自己的网络摄像头的信息,在用人员行为识别检测的时候,跑了50帧左右就自动结束了,之后我加了一些日志代码
def capturevideo(self, capture, queue):
frame_id = 0
logging.info("开始捕获视频流")
while (1):
if queue.full():
time.sleep(0.1)
else:
ret, frame = capture.read()
if not ret:
err_code = capture.get(cv2.CAP_PROP_POS_MSEC)
logging.error(f"无法从视频流中读取帧,错误代码:{err_code}")
# 检查是否到达视频流的末尾
if err_code == 0:
logging.error("可能已到达视频流的末尾")
else:
logging.error("视频流读取错误,可能是网络问题或视频源问题")
break # 或者根据需要处理错误
frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
queue.put(frame_rgb)
logging.debug(f"成功读取帧 {frame_id}")
frame_id += 1
发现最后会报"可能已到达视频流的末尾"这行字,然后视频会正常保存,所以这是程序的问题还是摄像头的问题呢?
The text was updated successfully, but these errors were encountered: