camera.startCapture
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据 的值开始拍摄视频,或以间隔拍摄图片
选项中的 captureMode
。
此命令是在 API 级别 2 中添加的。
参数
- 此命令的请求正文中没有参数。是否为间隔图片
拍摄或视频拍摄由
captureMode
选项决定。
对于固定间隔拍摄,是否采用开放式拍摄取决于
captureNumber
是否等于或大于 0。
captureMode
、captureInterval
和
需要在间隔拍摄之前设置 captureNumber
。
只有 captureMode
需要设置为“视频”视频播放前
捕获,只能通过 camera.stopCapture 命令停止。
结果
- 开放式捕获(当 captureMode == "video"或 captureNumber == 0 时)
<ph type="x-smartling-placeholder">
- 非开放式间隔拍摄:
<ph type="x-smartling-placeholder">
</ph>
- fileUrls::指向图片的绝对网址列表
用于间隔捕获的文件。请注意,此命令不会返回
fileUrls
,因为拍摄
captureNumber
即可完成。命令的进度可以是
获得的值。例如,在
预计用时(time = captureInterval * (captureNumber - 1)
)
使用 /osc/commands/status API
fileUrls
是命令完成后返回的结果。
如果命令未成功完成(例如,只有 3 张图片中的
或相机已断开连接)
但命令成功完成,
客户端应该能够使用
camera.listFiles
系统稍后会在客户端和相机之间建立新的连接时发送。
错误
- disabledCommand:命令当前已停用;例如,相机
正在进行视频拍摄或间隔拍摄。
- invalidParameterName:参数名称无法识别;例如
无法识别
sessionId
。
命令 I/O |
命令输入 |
none |
命令输出 |
{
"results": {
"fileUrls":[
"url1",
"url2",
"url3",
...
"urln"
]
}
} |
命令输出(错误) |
{
"error": {
"code": "disabledCommand",
"message": "Command is currently disabled."
}
} |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["\u003cp\u003eInitiates either video or interval image capture based on pre-set capture mode.\u003c/p\u003e\n"],["\u003cp\u003eFor interval capture, \u003ccode\u003ecaptureMode\u003c/code\u003e, \u003ccode\u003ecaptureInterval\u003c/code\u003e, and \u003ccode\u003ecaptureNumber\u003c/code\u003e options must be configured beforehand.\u003c/p\u003e\n"],["\u003cp\u003eFor video capture, only \u003ccode\u003ecaptureMode\u003c/code\u003e needs to be set to "video" and can be stopped using the \u003ccode\u003ecamera.stopCapture\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe command results for non-open-ended interval capture include a list of image URLs accessible after capture completion, retrievable via polling or \u003ccode\u003ecamera.listFiles\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eErrors like "disabledCommand" occur if the camera is already capturing or "invalidParameterName" if an unrecognized parameter is used.\u003c/p\u003e\n"]]],["This command initiates video or interval image capture based on the `captureMode` setting. For interval capture, `captureNumber` determines if it's open-ended; `captureInterval` and `captureNumber` must be preset. Video capture, set by `captureMode`, is ended via `camera.stopCapture`. Open-ended capture has no immediate results. Non-open-ended interval capture eventually provides a `fileUrls` list, accessible after the completion time or if interrupted. Errors include `disabledCommand` and `invalidParameterName`. The command's input is null, and output results with file URLs.\n"],null,["# camera.startCapture\n\nStarts video capture or interval image capture depending on value of\n`captureMode` in [Options](/streetview/open-spherical-camera/reference/options).\n**This command was added in API level 2.**\n\nParameters\n----------\n\n- This command has no parameter in request body. Whether it is interval image capture or video capture is determined by `captureMode` option. For interval capture, whether it is open ended capture or not depends on whether `captureNumber` is equal to or larger than 0. `captureMode`, `captureInterval` and `captureNumber` need to be set prior to interval capture. Only `captureMode` needs to be set to \"video\" prior to video capture, which can only be stopped by [camera.stopCapture](/streetview/open-spherical-camera/reference/camera/stopcapture) command.\n\nResults\n-------\n\n- Open-ended capture (when captureMode == \"video\" or captureNumber == 0)\n - No results.\n- Non-open-ended interval capture:\n - **fileUrls:** A list of absolute URLs, pointing to image files for interval capture. Please note this command doesn't return `fileUrls` immediately since the capture takes `captureNumber` to complete. The progress of the command can be obtained by polling the camera periodically. For example, poll after an estimated duration (`time = captureInterval * (captureNumber - 1)`) using the [/osc/commands/status](/streetview/open-spherical-camera/guides/osc/commands/status) API and `fileUrls` is the result returned when the command finishes. If the command doesn't finish successfully (e.g. only 3 out of images were taken before the camera runs out of battery) or the camera is disconnected from the client phone in the middle, but the command does finish successfully, the client should be able to obtain the images using the [camera.listFiles](/streetview/open-spherical-camera/reference/camera/listfiles) later when a new connection is established between the client and the camera.\n\nErrors\n------\n\n- **disabledCommand:** Command is currently disabled; for example, the camera is in the middle of a video capture or an interval capture.\n- **invalidParameterName:** The parameter name is unrecognized; for example, `sessionId` is not recognized.\n\n| Command I/O ----------- ||\n|----------------------------|-----------------------------------------------------------------------------------------------------|\n| **Command Input** | ```text none ``` |\n| **Command Output** | ```text { \"results\": { \"fileUrls\":[ \"url1\", \"url2\", \"url3\", ... \"urln\" ] } } ``` |\n| **Command Output (Error)** | ```text { \"error\": { \"code\": \"disabledCommand\", \"message\": \"Command is currently disabled.\" } } ``` |"]]