PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

在使用RTSP推流时出现av_interleaved_write_frame(): Broken pipe的报错

Open Football-Player-21 opened this issue 2 years ago • 5 comments

问题确认 Search before asking

  • [X] 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

No response

Bug描述 Describe the Bug

PaddlePaddle版本:v2.5.1 PaddleDetection版本:v2.6 在使用pphuman对视频进行处理并通过RTSP推流时: python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_pphuman.yml --video_file=/xxx/1.mp4 --device=cpu --enable_mkldnn=True --pushurl rtsp://[server_ip]:8554 在程序运行一段时间(大约十几秒)之后,出现如下报错: image

RTST推流使用mediamtx提供的官方Docker

复现环境 Environment

PaddlePaddle: 2.5.1 PaddleDetection: 2.6 Mediamtx: v1.1.0 Ubuntu: 20.04

Bug描述确认 Bug description confirmation

  • [X] 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • [ ] 我愿意提交PR!I'd like to help by submitting a PR!

Football-Player-21 avatar Sep 19 '23 04:09 Football-Player-21

这个错误本质是你推流的时候一端在读,一端在写,你已经没有可以写的帧了还在往里写导致的。 本质是循环判断有毛病,前面的issue中也提到过我不知道官方为什么过一个版本了仍不修改。 摄像头检测很多时候都是空帧会导致queue消耗太快提前终止循环。 deploy/pipeline/pipeline.py里修改这一段:

framequeue = queue.Queue(10)
thread = threading.Thread(
            target=self.capturevideo, args=(capture, framequeue))
thread.start()
time.sleep(1)

while (not framequeue.empty()):               

把这个not framequeue.empty去掉,可以换成一直启动,同时把queue改大一点或者干脆删掉这部分,我不明白queue在这里存在的意义是什么,缓存队列?但实际使用中并无需要吧。

EscaticZheng avatar Oct 26 '23 06:10 EscaticZheng

#7827

EscaticZheng avatar Oct 26 '23 06:10 EscaticZheng

感谢楼上回复

zhiboniu avatar Mar 04 '24 03:03 zhiboniu

这个错误本质是你推流的时候一端在读,一端在写,你已经没有可以写的帧了还在往里写导致的。 本质是循环判断有毛病,前面的issue中也提到过我不知道官方为什么过一个版本了仍不修改。 摄像头检测很多时候都是空帧会导致queue消耗太快提前终止循环。 deploy/pipeline/pipeline.py里修改这一段:

framequeue = queue.Queue(10)
thread = threading.Thread(
            target=self.capturevideo, args=(capture, framequeue))
thread.start()
time.sleep(1)

while (not framequeue.empty()):               

把这个not framequeue.empty去掉,可以换成一直启动,同时把queue改大一点或者干脆删掉这部分,我不明白queue在这里存在的意义是什么,缓存队列?但实际使用中并无需要吧。

赞同,我觉得直接将读取视频帧放到主线程就好,还不用处理因为主线程结束,子线程无法正常结束的问题

Chenkeyi43 avatar Mar 25 '24 08:03 Chenkeyi43