Skip to main content

Receiving frames from camera in subnet browsers via WebRTC

Project description

Receive WebRTC Camera Stream with aiortc

See also BrowserCam

Signaling

WebSocket with JSON, message format below:

SDP Exchange (Offer/Answer): same as RTCSessionDescriptionInit, { type: "offer/anwser", sdp: "<SDP>" }

ICE Candidate: { type: "candidate", candidate: RTCLocalIceCandidateInit | undefined }

Example

import cv2
from rtcam import CameraThread

camera = CameraThread(f'wss://{signaling_server_addr}/signal')
camera.start()

while True:
    if camera.frame is None: continue
    cv2.imshow("Browser Camera", camera.frame.to_ndarray(format='bgr24'))
    if cv2.waitKey(1) == 27: break

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rtcam-0.0.5.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rtcam-0.0.5-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file rtcam-0.0.5.tar.gz.

File metadata

  • Download URL: rtcam-0.0.5.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.11

File hashes

Hashes for rtcam-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d15bb62200a818e3e18b6f1231435ce79380335d6f810be61009bab692a3e125
MD5 121184f5ae52e945cfc9e9d7512ec787
BLAKE2b-256 0b0a54f8593284fbab2b9b7436110bc341bd9363cc72651af76759203cb703a8

See more details on using hashes here.

File details

Details for the file rtcam-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: rtcam-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.11

File hashes

Hashes for rtcam-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 da8cecc8bddaa4a9782b06ad9f3fa7e549a8e529b46e243c77692759eee4c72d
MD5 b7445ec8686fc8e6754c3f2e980fe7fd
BLAKE2b-256 cfb542c2e8b2bd7a49a4709b0aecfe173fa33d2caf2c0d8eb7044d20d51b74fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page