MCPcopy Create free account
hub / github.com/Improbable-AI/VisionProTeleop / configure_video

Method configure_video

avp_stream/streamer.py:2515–2558  ·  view source on GitHub ↗

Configure video streaming parameters. Call this before serve(). This stores video configuration. The actual video track is created per-WebRTC connection when serve() is called. Args: device: Video device identifier (default: None for syn

(
        self,
        device: Optional[str] = None,
        format: Optional[str] = None,
        size: str = "640x480",
        fps: int = 30,
        stereo: bool = False,
    )

Source from the content-addressed store, hash-verified

2513 # ============================================================================
2514
2515 def configure_video(
2516 self,
2517 device: Optional[str] = None,
2518 format: Optional[str] = None,
2519 size: str = "640x480",
2520 fps: int = 30,
2521 stereo: bool = False,
2522 ):
2523 """
2524 Configure video streaming parameters. Call this before serve().
2525
2526 This stores video configuration. The actual video track is created
2527 per-WebRTC connection when serve() is called.
2528
2529 Args:
2530 device: Video device identifier (default: None for synthetic frames).
2531 Use "0:none" for macOS camera via avfoundation.
2532 format: Video format (default: "avfoundation" for macOS).
2533 Ignored if device=None.
2534 size: Frame size as "WIDTHxHEIGHT" string (default: "640x480")
2535 fps: Frame rate (default: 30)
2536 stereo: If True, stream side-by-side stereo video (default: False)
2537
2538 Example::
2539
2540 streamer.configure_video(device=None, size="1280x720", fps=60)
2541 streamer.configure_audio() # optional
2542 streamer.start_webrtc()
2543 """
2544 # Parse size
2545 width, height = map(int, size.split('x'))
2546
2547 # Store configuration
2548 self._video_config = {
2549 "device": device,
2550 "format": format,
2551 "size": size,
2552 "fps": fps,
2553 "stereo": stereo,
2554 "width": width,
2555 "height": height,
2556 }
2557
2558 self._log(f"[CONFIG] Video configured: {size} @ {fps}fps (device={device}, stereo={stereo})")
2559
2560 def configure_audio(
2561 self,

Calls 1

_logMethod · 0.95

Tested by

no test coverage detected