summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/config.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/config.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/config.py b/packages/meshbay-node/src/meshbay_node/config.py
index 8372e5c..e7f3116 100644
--- a/packages/meshbay-node/src/meshbay_node/config.py
+++ b/packages/meshbay-node/src/meshbay_node/config.py
@@ -46,6 +46,11 @@ device_request_ttl_minutes = 60
# lower it on a Pi.
max_concurrent_streams = 8
+# HEVC sources have no browser decoder on most platforms, so streaming one is
+# transcoded to H264 rather than the usual free copy — real CPU per viewer.
+# Set to false only if every viewer's client is known to decode HEVC itself.
+transcode_incompatible_video = true
+
# Browser and native clients reach this node over WebRTC DataChannel via hub
# signaling — no inbound port to open. QUIC is the optional direct path.
@@ -120,6 +125,14 @@ class NodeConfig:
# the node answers "server busy" — see MAX_CONCURRENT_TRANSCODES in
# transport/webrtc_server.py for what one costs.
max_concurrent_streams: int = 8
+ # HEVC (and any future codec in media_probe.py's
+ # BROWSER_INCOMPATIBLE_VIDEO_CODECS) has no decoder in most browsers, so
+ # streaming it needs a real re-encode to H264 rather than the usual free
+ # copy. On by default since the alternative is a hard "codec not
+ # supported" error; set to false if this node's viewers are all clients
+ # that already decode the source codec directly, since transcoding costs
+ # real CPU per concurrent viewer, unlike the copy path.
+ transcode_incompatible_video: bool = True
@dataclass
@@ -275,6 +288,8 @@ def load_config(path: Path = DEFAULT_CONFIG_PATH) -> Config:
cfg.node.max_concurrent_streams = _positive(
nd.get("max_concurrent_streams", cfg.node.max_concurrent_streams),
cfg.node.max_concurrent_streams, "max_concurrent_streams")
+ cfg.node.transcode_incompatible_video = bool(
+ nd.get("transcode_incompatible_video", cfg.node.transcode_incompatible_video))
# Multi-group: [[groups]] array
if "groups" in raw: