Skip to content

Commit

Permalink
config.json is added
Browse files Browse the repository at this point in the history
  • Loading branch information
moghun committed Jan 3, 2023
1 parent 83e1875 commit cf4523b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Binary file modified __pycache__/frameStream.cpython-39.pyc
Binary file not shown.
Binary file modified __pycache__/server.cpython-39.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ip_address": "127.0.0.1"
}
9 changes: 7 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
import base64
import imagezmq
import time
import json

from threading import Thread, Event

from frameStream import frameStream, VideoStreamWidget


file = open("config.json")
config = json.load(file)
ip = config['ip_address']
file.close()

currentFile = Path(__file__).parent
UPLOAD_FOLDER = os.path.join(currentFile, "registrations")
Expand All @@ -29,7 +34,7 @@
streaming_flag = False
streamer = ""
image_hub = ""
connect_to_p = "tcp://0.0.0.0:5555"
connect_to_p = 'tcp://' + ip +':5555'
multiple_devices = False

for room in os.listdir(UPLOAD_FOLDER):
Expand Down Expand Up @@ -258,7 +263,7 @@ def video_feed():
global connect_to_p

print("Other frame stream:", streaming_flag)
new_cnct = 'tcp://0.0.0.0:555' + str(5+int(room_number))
new_cnct = 'tcp://' + ip +':555' + str(5+int(room_number))
if new_cnct != connect_to_p:
if image_hub != "":
image_hub.zmq_socket.close()
Expand Down

0 comments on commit cf4523b

Please sign in to comment.