
15.97 MB
Android 7.0+
12
arm64-v8a, armeabi-v7a, x86, x86_64
Verified safeScanned with ClamAV, APKiD, and Quark-Engine. No threats detected.
Screenshots


Description
Easily access your device's camera using a WebSocket client API to perform real-time AI and computer vision tasks on a live video stream.
The app broadcasts live camera frames as JPEG images over WebSocket connections, allowing multiple clients to connect concurrently and perform AI or computer vision processing in parallel.
Displaying the live camera stream using Python
A simple Python example using OpenCV and WebSocket libraries to connect to the WebSocket CAM app and display the live camera stream.
pip install opencv-python numpy websocket-client
import cv2
import numpy as np
import websocket
SERVER_URL = "ws://192.168.18.50:8080"
def on_message(ws, message):
# Convert received bytes into a numpy array
np_arr = np.frombuffer(message, np.uint8)
frame = cv2.imdecode(np_arr, cv2.IMREAD_COLOR)
if frame is not None:
cv2.imshow("Camera Stream", frame)
if cv2.waitKey(1) & 0xFF == 27: # ESC key to exit
ws.close()
cv2.destroyAllWindows()
else:
print("Failed to decode frame")
def on_error(ws, error):
print("WebSocket error:", error)
def on_close(ws, close_status_code, close_msg):
print("Connection closed:", close_status_code, close_msg)
cv2.destroyAllWindows()
def on_open(ws):
print("Connected to WebSocket CAM. Open the camera to see the live stream.")
if __name__ == "__main__":
websocket.enableTrace(False)
ws = websocket.WebSocketApp(
SERVER_URL,
on_open=on_open,
on_message=on_message,
on_error=on_error,
on_close=on_close,
)
try:
ws.run_forever()
except KeyboardInterrupt:
print("\nStopped by user")
ws.close()
cv2.destroyAllWindows()
Start the WebSocket server in the app, then run this Python script in multiple terminals to view several live streams simultaneously.
Examples
Working examples of this app are available here:
https://github.com/UmerCodez/WebsocketCAM-examples
License
GNU General Public License v3.0
Rate this app
Ratings & reviews
No reviews yet.