Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
divdaisymuffin opened this issue Jan 28, 2021 · 11 comments

Comments

@divdaisymuffin
Copy link

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
Copy link
Collaborator

xwu2git commented Jan 28, 2021

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
Copy link
Author

divdaisymuffin commented Jan 29, 2021

@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
Copy link
Collaborator

xwu2git commented Jan 29, 2021

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
Copy link
Author

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

@divdaisymuffin
Copy link
Author

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
Copy link
Author

divdaisymuffin commented Jan 29, 2021

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
Copy link
Collaborator

xwu2git commented Jan 31, 2021

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
Copy link
Author

@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
Copy link
Collaborator

xwu2git commented Feb 8, 2021

yes

@divdaisymuffin
Copy link
Author

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

@akshayp1099
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants