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.2.tar.gz (2.5 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.2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rtcam-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b45ac0daba97ded763caf01592b4d2188b89b4fd65aff9c13edb3b818c559f1f
MD5 5f56a5da5d79681df086f0e6b6a11e53
BLAKE2b-256 e5c503e0acc199eee682e9fe8e31e00c5ecba330b561c98f245d4a7a53ed5210

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rtcam-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ad147c078e60ec2975d9a8669c10e79bd9cdb5adeaafc8b7560b1726ebb7163
MD5 da0e2bf65556e99a5a0278d24d11543c
BLAKE2b-256 c81cf522549c633536f1e7a9520bb500bdbcdadfcee7b9e3f702630affb84bd4

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