mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 02:24:38 +08:00
Allow users to skip using openrelay (#1042)
This commit is contained in:
parent
8fc7950719
commit
bce963facc
@ -183,6 +183,9 @@ class ViewerConfig(PrintableConfig):
|
||||
actually used in training/evaluation. If -1, display all."""
|
||||
quit_on_train_completion: bool = False
|
||||
"""Whether to kill the training job when it has completed. Note this will stop rendering in the viewer."""
|
||||
skip_openrelay: bool = False
|
||||
"""Avoid using openrelay to communicate with the viewer. Try disabling if you have trouble
|
||||
connecting to the viewer"""
|
||||
|
||||
|
||||
from nerfstudio.engine.optimizers import OptimizerConfig
|
||||
|
||||
@ -508,25 +508,28 @@ class ViewerState:
|
||||
# returns the description to for WebRTC to the specific websocket connection
|
||||
offer = RTCSessionDescription(data["sdp"], data["type"])
|
||||
|
||||
pc = RTCPeerConnection(
|
||||
configuration=RTCConfiguration(
|
||||
iceServers=[
|
||||
RTCIceServer(urls="stun:stun.l.google.com:19302"),
|
||||
RTCIceServer(urls="stun:openrelay.metered.ca:80"),
|
||||
RTCIceServer(
|
||||
urls="turn:openrelay.metered.ca:80", username="openrelayproject", credential="openrelayproject"
|
||||
),
|
||||
RTCIceServer(
|
||||
urls="turn:openrelay.metered.ca:443", username="openrelayproject", credential="openrelayproject"
|
||||
),
|
||||
RTCIceServer(
|
||||
urls="turn:openrelay.metered.ca:443?transport=tcp",
|
||||
username="openrelayproject",
|
||||
credential="openrelayproject",
|
||||
),
|
||||
]
|
||||
)
|
||||
)
|
||||
if self.config.skip_openrelay:
|
||||
ice_servers = [
|
||||
RTCIceServer(urls="stun:stun.l.google.com:19302"),
|
||||
]
|
||||
else:
|
||||
ice_servers = [
|
||||
RTCIceServer(urls="stun:stun.l.google.com:19302"),
|
||||
RTCIceServer(urls="stun:openrelay.metered.ca:80"),
|
||||
RTCIceServer(
|
||||
urls="turn:openrelay.metered.ca:80", username="openrelayproject", credential="openrelayproject"
|
||||
),
|
||||
RTCIceServer(
|
||||
urls="turn:openrelay.metered.ca:443", username="openrelayproject", credential="openrelayproject"
|
||||
),
|
||||
RTCIceServer(
|
||||
urls="turn:openrelay.metered.ca:443?transport=tcp",
|
||||
username="openrelayproject",
|
||||
credential="openrelayproject",
|
||||
),
|
||||
]
|
||||
|
||||
pc = RTCPeerConnection(configuration=RTCConfiguration(iceServers=ice_servers))
|
||||
self.pcs.add(pc)
|
||||
|
||||
video = SingleFrameStreamTrack()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user