Commit
•
b8f6567
1
Parent(s):
4fce009
feat: add rtmp support (#1009)
Browse files* feat: add rtmp support
* Update detect.py
pass tuple to source.startswith()
Co-authored-by: ryan.fu <ryan.fu@aylaasia.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
README.md
CHANGED
@@ -77,6 +77,7 @@ $ python detect.py --source 0 # webcam
|
|
77 |
path/ # directory
|
78 |
path/*.jpg # glob
|
79 |
rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa # rtsp stream
|
|
|
80 |
http://112.50.243.8/PLTV/88888888/224/3221225900/1.m3u8 # http stream
|
81 |
```
|
82 |
|
|
|
77 |
path/ # directory
|
78 |
path/*.jpg # glob
|
79 |
rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa # rtsp stream
|
80 |
+
rtmp://192.168.1.105/live/test # rtmp stream
|
81 |
http://112.50.243.8/PLTV/88888888/224/3221225900/1.m3u8 # http stream
|
82 |
```
|
83 |
|
detect.py
CHANGED
@@ -21,7 +21,7 @@ from utils.torch_utils import select_device, load_classifier, time_synchronized
|
|
21 |
def detect(save_img=False):
|
22 |
out, source, weights, view_img, save_txt, imgsz = \
|
23 |
opt.output, opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size
|
24 |
-
webcam = source.isnumeric() or source.startswith('rtsp'
|
25 |
|
26 |
# Initialize
|
27 |
set_logging()
|
|
|
21 |
def detect(save_img=False):
|
22 |
out, source, weights, view_img, save_txt, imgsz = \
|
23 |
opt.output, opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size
|
24 |
+
webcam = source.isnumeric() or source.startswith(('rtsp://', 'rtmp://', 'http://')) or source.endswith('.txt')
|
25 |
|
26 |
# Initialize
|
27 |
set_logging()
|