Files
root 95bb7c50ee feat: point the fleet at wss LiveKit room uwh-telhai
Publish and subscribe over wss://livekit.uni-wh.de:7800 and refuse
cleartext ws://. Conference room is uwh-telhai. Includes the uncommitted
encoded H.264 publish path, Rally hairpin, and KMS wall overlay.
2026-10-11 00:48:50 +00:00

41 lines
1.2 KiB
Python

"""GStreamer ALSA capture graphs for the shared audio daemon."""
from __future__ import annotations
import shutil
GST_LAUNCH = shutil.which("gst-launch-1.0") or "gst-launch-1.0"
GST_GROUP_SIZE = 5
def shared_audio_cmd(
cameras: list[tuple[str, int]],
rate: int,
fds: list[int],
) -> list[str]:
if len(cameras) != len(fds):
raise ValueError("cameras and fds length mismatch")
cmd: list[str] = [GST_LAUNCH, "-q"]
caps = f"audio/x-raw,format=S16LE,rate={int(rate)},channels=2"
for (_ident, card), fd in zip(cameras, fds):
cmd += [
"alsasrc", f"device=hw:{int(card)},0", "do-timestamp=false",
"!", caps,
"!", "queue", "max-size-buffers=2", "max-size-bytes=0",
"max-size-time=0", "leaky=downstream",
"!", "fdsink", f"fd={int(fd)}", "sync=false",
]
return cmd
def grouped_audio(
cameras: list[tuple[str, int]],
fds: list[int],
group_size: int = GST_GROUP_SIZE,
) -> list[tuple[list[tuple[str, int]], list[int]]]:
if group_size < 1:
raise ValueError("group_size must be >= 1")
out = []
for i in range(0, len(cameras), group_size):
out.append((cameras[i:i + group_size], fds[i:i + group_size]))
return out