跳到正文
所有工具

screen_record_start

屏幕、窗口与界面 · macOS

效果: 写入. 状态: 受限可用.

“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。

macOS

用途

开始对显示器、窗口或区域进行屏幕录制(ScreenCaptureKit)。v1 中同一时间只有一个活动会话——再次开始会返回 already_recording。返回 session_id,供 record_marker 和 screen_record_stop 使用。需要屏幕录制权限;没有该权限时会返回明确的 permission_required 错误,绝不会静默无操作。首次调用返回预览;confirm: true 才会开始录制。

必填输入

输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。

权限与确认

架构声明了明确的确认参数。请检查预览,并按此平台的契约授权实际操作。

英文规范技术架构 — macOS
{
  "properties": {
    "confirm": {
      "description": "Must be true to start recording. Without it the call returns a preview and captures nothing.",
      "type": "boolean"
    },
    "fps": {
      "description": "Frames per second (default 60).",
      "type": "integer"
    },
    "output_path": {
      "description": "Where to write the .mov (default: temp file, returned by stop). Missing parent folders are created.",
      "type": "string"
    },
    "show_cursor": {
      "description": "Default true.",
      "type": "boolean"
    },
    "target": {
      "description": "What to capture.",
      "properties": {
        "display_id": {
          "description": "Required if kind=display.",
          "type": "string"
        },
        "kind": {
          "enum": [
            "display",
            "window",
            "region"
          ],
          "type": "string"
        },
        "region": {
          "description": "Required if kind=region: {x,y,w,h} global points.",
          "type": "object"
        },
        "window_id": {
          "description": "Required if kind=window.",
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    }
  },
  "required": [
    "target"
  ],
  "type": "object"
}

文档示例

screen_record_start 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。

{
  "confirm": false,
  "target": {
    "display_id": "1",
    "kind": "display"
  }
}