From 584205294f788178e41b5f727bf02913d2679f8e Mon Sep 17 00:00:00 2001 From: stone99 Date: Wed, 23 Sep 2020 02:37:49 +0800 Subject: [PATCH] feat: add rtmp support (#1009) * feat: add rtmp support * Update detect.py pass tuple to source.startswith() Co-authored-by: ryan.fu Co-authored-by: Glenn Jocher --- README.md | 1 + detect.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e625061ecd4..5275e9d33ef7 100755 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ $ python detect.py --source 0 # webcam path/ # directory path/*.jpg # glob rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa # rtsp stream + rtmp://192.168.1.105/live/test # rtmp stream http://112.50.243.8/PLTV/88888888/224/3221225900/1.m3u8 # http stream ``` diff --git a/detect.py b/detect.py index fd2c14d1ba2e..7610f39ab2ea 100644 --- a/detect.py +++ b/detect.py @@ -21,7 +21,7 @@ def detect(save_img=False): out, source, weights, view_img, save_txt, imgsz = \ opt.output, opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size - webcam = source.isnumeric() or source.startswith('rtsp') or source.startswith('http') or source.endswith('.txt') + webcam = source.isnumeric() or source.startswith(('rtsp://', 'rtmp://', 'http://')) or source.endswith('.txt') # Initialize set_logging()