chore: mid-bugfixing
This commit is contained in:
@@ -68,13 +68,19 @@ class VideoSender(SocketBase):
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'): # << Add this: Updates the window
|
||||
break
|
||||
|
||||
small_frame = cv2.resize(frame, (320, 240), interpolation=cv2.INTER_AREA)
|
||||
encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 70]
|
||||
_, buffer = cv2.imencode('.jpg', small_frame, encode_param)
|
||||
height, width, channels = frame.shape
|
||||
print(width)
|
||||
print(height)
|
||||
pixel_data = frame.tobytes()
|
||||
|
||||
#cv2.imshow("Sender Preview", small_frame) # << Add this: Opens the window
|
||||
width_bytes = struct.pack('<I', width)
|
||||
height_bytes = struct.pack('<I', height)
|
||||
|
||||
self.socket.send(buffer.tobytes())
|
||||
#print("Sending frames")
|
||||
#print(width_bytes)
|
||||
#print(height_bytes)
|
||||
#print(pixel_data)
|
||||
self.socket.send_multipart([b"",width_bytes, height_bytes, pixel_data])
|
||||
|
||||
cap.release()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user