diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/config.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/config.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/config.py b/packages/meshbay-node/src/meshbay_node/config.py index 7351b1c..086d800 100644 --- a/packages/meshbay-node/src/meshbay_node/config.py +++ b/packages/meshbay-node/src/meshbay_node/config.py @@ -72,6 +72,15 @@ max_concurrent_uploads = 8 # Set to false only if every viewer's client is known to decode HEVC itself. transcode_incompatible_video = true +# Use the GPU for that re-encode when there is one that works — VA-API here, +# Quick Sync or NVENC on Windows. Established by encoding 1080p and checking +# the result, never guessed from the hardware, and ignored where the test +# fails: this is on by default and the only reason to turn it off is a driver +# that misbehaves in a way the test does not catch. On an Intel mini-PC it is +# the difference between transcoding in real time and having to set +# transcode_incompatible_video = false. +hardware_video_encode = true + # ICE candidate gathering. By default, virtual/VPN interfaces (Tailscale, # libvirt, Docker) are auto-excluded — a STUN request that can't reach the # server holds the WebRTC answer for 5 seconds. Set this to restrict @@ -180,6 +189,12 @@ class NodeConfig: # that already decode the source codec directly, since transcoding costs # real CPU per concurrent viewer, unlike the copy path. transcode_incompatible_video: bool = True + # Whether that re-encode may run on the GPU. See hwaccel.py: the capability + # is established by encoding and reading the result back, so `true` here + # means "use it if it works", never "assume it does". Off returns the node + # to libx264 on every stream, which is where it was before hardware + # encoding existed. + hardware_video_encode: bool = True # ICE candidate gathering: which network interfaces to include or exclude. # By default, virtual and VPN interfaces (Tailscale, libvirt, Docker) are # auto-excluded because a STUN request that can't reach the server holds @@ -355,6 +370,8 @@ def load_config(path: Path = DEFAULT_CONFIG_PATH) -> Config: cfg.node.max_concurrent_uploads, "max_concurrent_uploads") cfg.node.transcode_incompatible_video = bool( nd.get("transcode_incompatible_video", cfg.node.transcode_incompatible_video)) + cfg.node.hardware_video_encode = bool( + nd.get("hardware_video_encode", cfg.node.hardware_video_encode)) ice_if = nd.get("ice_interfaces") if isinstance(ice_if, list): cfg.node.ice_interfaces = [str(s) for s in ice_if] |