MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / start

Method start

unity_cli/api/recorder.py:17–53  ·  view source on GitHub ↗

Start recording frames. Args: fps: Target frames per second (default: 30, max: 120) format: Image format - "png" or "jpg" (default: jpg) quality: JPEG quality 1-100 (default: 75) width: Image width (default: 1920) height: Image hei

(
        self,
        fps: int = 30,
        format: Literal["png", "jpg"] = "jpg",
        quality: int = 75,
        width: int = 1920,
        height: int = 1080,
        camera: str | None = None,
        output_dir: str | None = None,
    )

Source from the content-addressed store, hash-verified

15 self._conn = conn
16
17 def start(
18 self,
19 fps: int = 30,
20 format: Literal["png", "jpg"] = "jpg",
21 quality: int = 75,
22 width: int = 1920,
23 height: int = 1080,
24 camera: str | None = None,
25 output_dir: str | None = None,
26 ) -> dict[str, Any]:
27 """Start recording frames.
28
29 Args:
30 fps: Target frames per second (default: 30, max: 120)
31 format: Image format - "png" or "jpg" (default: jpg)
32 quality: JPEG quality 1-100 (default: 75)
33 width: Image width (default: 1920)
34 height: Image height (default: 1080)
35 camera: Camera GameObject name. Uses Main Camera if not specified.
36 output_dir: Output directory. Auto-generated if not specified.
37
38 Returns:
39 Dictionary with recording start info.
40 """
41 params: dict[str, Any] = {
42 "action": "start",
43 "fps": fps,
44 "format": format,
45 "quality": quality,
46 "width": width,
47 "height": height,
48 }
49 if camera is not None:
50 params["camera"] = camera
51 if output_dir is not None:
52 params["outputDir"] = output_dir
53 return self._conn.send_request("recorder", params)
54
55 def stop(self) -> dict[str, Any]:
56 """Stop recording and get results.

Callers 3

start_update_checkFunction · 0.45
recorder_startFunction · 0.45
profiler_startFunction · 0.45

Calls 1

send_requestMethod · 0.80

Tested by

no test coverage detected