OpenVisualCloud / Smart-City-Sample

The smart city reference pipeline shows how to integrate various media building blocks, with analytics powered by the OpenVINO™ Toolkit, for traffic or stadium sensing, analytics and management tasks.
BSD 3-Clause "New" or "Revised" License
191 stars 82 forks source link

Attaching one live stream camera to two different usecases in stadium scenario #732

Open divdaisymuffin opened 3 years ago

divdaisymuffin commented 3 years ago

I am not able to give one live stream camera feed from sensor-info.json to two different use cases like Entrance and svcq in Stadium scenario. issue1 I have given same details of IP camera into sensor-info but Smart city is not taking the same feed into two use case, one use case its showing N/A. It is showing 1:1 ratio for camera and use case.

xwu2git commented 3 years ago

I see two services are running. Is there anything wrong? Can you show how you assign the same IP camera to two services in sensor-info.json?

divdaisymuffin commented 3 years ago

@xwu2git Okay, let me explain in detail, I have two IP cameras, (192.168.1.23 and 192.168.1.24) I want to run svcq with both of them and similarly entrance also with both of them, but right now its giving one IP camera (192.168.1.23) to Svcq and another to entrance (192.168.1.24). The changes I made in sensor-info.json are: { "address": "North West Exit", "location": { "lat": 37.39628, "lon": -121.97461 }, "algorithm": "entrance-counting", "theta": 225.0, "passcode": "admin:12345678", "ip": "192.168.1.24", "port": [ 80, 9988, 554, 85], "rtspurl": "rtsp://admin:123456@192.168.1.24:85/videoMainsc" },{ "address": "South West Exit", "location": { "lat": 37.38077, "lon": -121.97388 }, "algorithm": "entrance-counting", "theta": 315.0, "passcode": "admin:12345678", "ip": "192.168.1.23", "port": [ 80, 9988, 554, 85], "rtspurl": "rtsp://admin:123456@192.168.1.23:85/videoMainsc" }

for svcq: { "address": "North West Restaurant", "location": { "lat": 37.39821, "lon": -121.96969 }, "algorithm": "svcq-counting", "theta": 0.0, "passcode": "admin:12345678", "ip": "192.168.1.24", "port": [ 80, 9988, 554, 85], "rtspurl": "rtsp://admin:123456@192.168.1.24:85/videoMainsc" },{ "address": "North East Restaurant", "location": { "lat": 37.39804, "lon": -121.95195 }, "algorithm": "svcq-counting", "theta": 0.0, "passcode": "admin:12345678", "ip": "192.168.1.23", "port": [ 80, 9988, 554, 85], "rtspurl": "rtsp://admin:123456@192.168.1.23:85/videoMainsc" }

xwu2git commented 3 years ago

The discover service uses the rtspurl to uniquely identify an IP camera. I guess there are totally two cameras discovered in your case. Try adding something unrelated to the rtspurl text to make them different: rtsp://admin:123456@192.168.1.23:85/videoMainsc?x=y. Hopefully ?x=y will not choke the IP camera.

divdaisymuffin commented 3 years ago

Thansk @xwu2git , but adding ?x=y is blocking the IP camera stream :(

divdaisymuffin commented 3 years ago

Additionally I have tried using Substream ("rtsp://admin:123456@192.168.1.23:85/videoSubsc" instead of mainstream to look rtspurl unique, which playing fine in VLC but not getting streamed in smartcity. I think it is taking IP as unique ID.

divdaisymuffin commented 3 years ago

Also tried with different port ("rtsp://admin:123456@192.168.1.23:554/videoMainsc"), that is also not working, which makes me think its is taking IP only as unique identifier

xwu2git commented 3 years ago

It's in sensor/discover-ipcam/discover.py around line 230. You might need to modify the discovery logic to allow the same IP cameras to be registered twice for different algorithms. This usage is not supported for now.

divdaisymuffin commented 3 years ago

@xwu2git Do you mean these lines in the discover.py, where it is checking for a camera already registered. # check database to see if this camera is already registered r=None if dbhost: try: if rtmp_host: r=list(dbs.search("rtspuri='{}'".format(rtspuri),size=1)) else: r=list(dbs.search("url='{}'".format(rtspuri),size=1)) if r: if r[0]["_source"]["status"]!="disconnected": print("Skipping {}:{}:{}".format(ip,port,r[0]["_source"]["status"]),flush=True) continue except: print(traceback.format_exc(), flush=True) continue

xwu2git commented 3 years ago

yes

divdaisymuffin commented 3 years ago

@xwu2git you can close this issue, problem is solved. :)

akshayp1099 commented 3 years ago

@xwu2git you can close this issue, problem is solved. :)

Hi, I am also facing this issue, can you provide the solution ?