Shababo/fix webrtc dep issue (#1437)
* update aiortic version * uncomment turn server lines * properly merge in main
This commit is contained in:
@@ -105,6 +105,7 @@
|
||||
# - install the necessary libs for processing video, `opencv` and `ffmpeg`, and
|
||||
# - install the necessary Python packages.
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import modal
|
||||
@@ -197,7 +198,7 @@ app = modal.App("example-webrtc-yolo")
|
||||
image=video_processing_image,
|
||||
gpu="A100-40GB",
|
||||
volumes=cache,
|
||||
# secrets=[modal.Secret.from_name("turn-credentials")],
|
||||
secrets=[modal.Secret.from_name("turn-credentials")],
|
||||
region="us-east", # set to your region
|
||||
)
|
||||
@modal.concurrent(
|
||||
@@ -239,18 +240,18 @@ class ObjDet(ModalWebRtcPeer):
|
||||
)
|
||||
|
||||
async def get_turn_servers(self, peer_id=None, msg=None) -> dict:
|
||||
# creds = {
|
||||
# "username": os.environ["TURN_USERNAME"],
|
||||
# "credential": os.environ["TURN_CREDENTIAL"],
|
||||
# }
|
||||
creds = {
|
||||
"username": os.environ["TURN_USERNAME"],
|
||||
"credential": os.environ["TURN_CREDENTIAL"],
|
||||
}
|
||||
|
||||
turn_servers = [
|
||||
# {"urls": "stun:stun.relay.metered.ca:80"}, # STUN is free, no creds neeeded
|
||||
# # for TURN, sign up for the free service here: https://www.metered.ca/tools/openrelay/
|
||||
# {"urls": "turn:standard.relay.metered.ca:80"} | creds,
|
||||
# {"urls": "turn:standard.relay.metered.ca:80?transport=tcp"} | creds,
|
||||
# {"urls": "turn:standard.relay.metered.ca:443"} | creds,
|
||||
# {"urls": "turns:standard.relay.metered.ca:443?transport=tcp"} | creds,
|
||||
{"urls": "stun:stun.relay.metered.ca:80"}, # STUN is free, no creds neeeded
|
||||
# for TURN, sign up for the free service here: https://www.metered.ca/tools/openrelay/
|
||||
{"urls": "turn:standard.relay.metered.ca:80"} | creds,
|
||||
{"urls": "turn:standard.relay.metered.ca:80?transport=tcp"} | creds,
|
||||
{"urls": "turn:standard.relay.metered.ca:443"} | creds,
|
||||
{"urls": "turns:standard.relay.metered.ca:443?transport=tcp"} | creds,
|
||||
]
|
||||
|
||||
return {"type": "turn_servers", "ice_servers": turn_servers}
|
||||
|
||||
Reference in New Issue
Block a user