feat: add rtmp support (#1009)
* 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>
This commit is contained in:
2 files changed
+2
-1
No files matched your search
@@ -77,6 +77,7 @@ $ python detect.py --source 0 # webcam
|
|||||||
path/ # directory
|
path/ # directory
|
||||||
path/*.jpg # glob
|
path/*.jpg # glob
|
||||||
rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa # rtsp stream
|
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
|
http://112.50.243.8/PLTV/88888888/224/3221225900/1.m3u8 # http stream
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from utils.torch_utils import select_device, load_classifier, time_synchronized
|
|||||||
def detect(save_img=False):
|
def detect(save_img=False):
|
||||||
out, source, weights, view_img, save_txt, imgsz = \
|
out, source, weights, view_img, save_txt, imgsz = \
|
||||||
opt.output, opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size
|
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
|
# Initialize
|
||||||
set_logging()
|
set_logging()
|
||||||
|
|||||||
Reference in new issue
Block a user