Files
livekit-cameras/tests/test_capture_va.py
T
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

51 lines
1.9 KiB
Python

from capture_va import grouped_cameras, shared_capture_cmd, video_capture_cmd
def test_video_capture_cmd_latest_frame_no_sidecar_h264():
cmd = video_capture_cmd("/dev/cam01", 640, 360, 30)
joined = " ".join(cmd)
assert "v4l2src" in joined
assert "device=/dev/cam01" in joined
assert "jpegdec" in joined
assert "videoconvert" in joined
assert "I420" in joined
assert "leaky=downstream" in joined
assert "max-size-buffers=1" in joined
assert "max-size-time=0" in joined
assert "fdsink" in joined
assert "h264enc" not in joined
assert "tee" not in joined
def test_capture_does_not_gst_crop_or_box():
"""MCU crop is Python-side on 07/14/15 only; gst stays full 360."""
for dev in ("/dev/cam01", "/dev/cam07"):
joined = " ".join(video_capture_cmd(dev, 640, 360, 30))
assert "videocrop" not in joined
assert "videobox" not in joined
assert "videoscale" not in joined
def test_shared_capture_cmd_one_process_no_sidecar_h264():
cams = [("cam-01", "/dev/cam01"), ("cam-02", "/dev/cam02")]
cmd = shared_capture_cmd(cams, 640, 360, 30, [8, 9])
joined = " ".join(cmd)
assert cmd[0].endswith("gst-launch-1.0") or "gst-launch-1.0" in cmd[0]
assert joined.count("v4l2src") == 2
assert joined.count("jpegdec") == 2
assert joined.count("videoconvert") == 2
assert joined.count("fdsink") == 2
assert "fd=8" in joined and "fd=9" in joined
assert "h264enc" not in joined
assert "tee" not in joined
def test_grouped_cameras_splits_into_small_pool():
cams = [(f"cam-{i:02d}", f"/dev/cam{i:02d}") for i in range(1, 21)]
fds = list(range(20, 40))
groups = grouped_cameras(cams, fds, 5)
assert len(groups) == 4
assert all(len(c) == 5 and len(f) == 5 for c, f in groups)
assert groups[0][0][0][0] == "cam-01"
assert groups[-1][0][-1][0] == "cam-20"