Skip to content

Commit

Permalink
Safe
Browse files Browse the repository at this point in the history
  • Loading branch information
moghun committed Jan 1, 2023
1 parent 04e45ec commit 8440a6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
Binary file modified __pycache__/server.cpython-39.pyc
Binary file not shown.
6 changes: 1 addition & 5 deletions frameStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ def start(self):
pass
print("Stream from the remote device is ended")






class VideoStreamWidget(object):
def __init__(self, src=0, onRPI=False):
self.sender = imagezmq.ImageSender(connect_to='tcp://*:5555', REQ_REP=False)
self.sender.zmq_socket.setsockopt(zmq.CONFLATE, 1)
self.sender.zmq_socket.setsockopt(zmq.SNDHWM, 1)
self.sender.zmq_socket.setsockopt(zmq.., 1)
self.sender.zmq_socket.setsockopt( zmq.LINGER, 0 )

if onRPI == False:
Expand Down
17 changes: 8 additions & 9 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def encoding_img(IMAGE_FILES):
while streaming_flag:
rpi_name, img = image_hub.recv_image()

# success, img = cap.read()
# success, img = cap.read()
imgc = cv2.resize(img, (0, 0), None, 0.25, 0.25)
# converting image to RGB from BGR
imgc = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
Expand Down Expand Up @@ -240,10 +240,10 @@ def encoding_img(IMAGE_FILES):
break


def start_streaming():
fs = frameStream()
fs.start()
print("STREAM THREAD JOINED")
# def start_streaming():
# fs = frameStream()
# fs.start()
# print("STREAM THREAD JOINED")


@app.route('/video_feed')
Expand All @@ -255,14 +255,13 @@ def video_feed():
print("Other frame stream:", streaming_flag)
if streaming_flag == False:
streaming_flag = True
streamer = Thread(target = start_streaming, args=())
streamer.start()
#streamer = Thread(target = start_streaming, args=())
#streamer.start()
print("Remote capture started")
return Response(gen(room_number),
mimetype='multipart/x-mixed-replace; boundary=frame')


def start_server():
app.run(debug=False , host="0.0.0.0", port="80")
print("Program ended")

print("Program ended")

0 comments on commit 8440a6d

Please sign in to comment.