change
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
[config]
|
[config]
|
||||||
urls=rtsp://admin:xkrs0425@172.16.20.15:554/D6/sub/av_stream,rtsp://admin:qd123456@172.16.20.13:554/D4/sub/av_stream
|
urls=rtsp://admin:xkrs0425@172.16.20.15:554/D6/sub/av_stream,rtsp://admin:qd123456@172.16.20.13:554/D4/sub/av_stream
|
||||||
wss=ws://172.16.10.97:8099/websocket/message/rtsp/d6,ws://172.16.10.97:8099/websocket/message/rtsp/d5
|
wss=ws://172.16.10.97:8099/websocket/message/rtsp/d6,ws://172.16.10.97:8099/websocket/message/rtsp/d5
|
||||||
api=http://172.16.10.97:8099/business/t_monitor_ai/add
|
api=http://172.16.10.97:8099/business/t_monitor_ai/add,http://172.16.10.97:8099/business/t_monitor_ai/add
|
8
main.py
8
main.py
@@ -27,8 +27,8 @@ def get_config():
|
|||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
rtsp_url = config.get('config', 'urls')
|
rtsp_url = config.get('config', 'urls')
|
||||||
wss = config.get('config', 'wss')
|
wss = config.get('config', 'wss')
|
||||||
api_url = config.get('config', 'api')
|
api_urls = config.get('config', 'api')
|
||||||
return wss.split(','), rtsp_url.split(','), api_url
|
return wss.split(','), rtsp_url.split(','), api_urls.split(',')
|
||||||
|
|
||||||
|
|
||||||
def process_camera(rtsp_url, ws_url, api_url=None):
|
def process_camera(rtsp_url, ws_url, api_url=None):
|
||||||
@@ -87,10 +87,10 @@ def on_open(ws):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
websocket_urls, rtsp_urls, api_url = get_config()
|
websocket_urls, rtsp_urls, api_urls = get_config()
|
||||||
for i in range(len(websocket_urls)):
|
for i in range(len(websocket_urls)):
|
||||||
if i == 0:
|
if i == 0:
|
||||||
thread = threading.Thread(target=process_camera, args=(rtsp_urls[i], websocket_urls[i], api_url))
|
thread = threading.Thread(target=process_camera, args=(rtsp_urls[i], websocket_urls[i], api_urls[i]))
|
||||||
else:
|
else:
|
||||||
thread = threading.Thread(target=process_camera, args=(rtsp_urls[i], websocket_urls[i], None))
|
thread = threading.Thread(target=process_camera, args=(rtsp_urls[i], websocket_urls[i], None))
|
||||||
thread.start()
|
thread.start()
|
Reference in New Issue
Block a user