เฉพาะผู้ให้บริการ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
API ระดับที่ 1 ของข้อกำหนดของ OSC API จะเน้นไปที่ประเภทรูปภาพ และจะเพิ่มการรองรับวิดีโอใน API ระดับ 2 ขอแนะนำให้ผู้ผลิตกล้องกำหนดคำสั่งที่กำหนดเองและ/หรือขยายชุดพารามิเตอร์ของคำสั่งมาตรฐาน หากจำเป็น พารามิเตอร์เหล่านี้เรียกว่าคำสั่งผู้ให้บริการและพารามิเตอร์ผู้ให้บริการ
ชื่อของคำสั่งและพารามิเตอร์เฉพาะผู้ให้บริการต้องเป็นตัวอักษรและตัวเลขนำหน้าด้วยเครื่องหมายขีดล่าง ( _ )
ฟังก์ชันการทำงานเฉพาะผู้ให้บริการมีอยู่ 4 อย่างดังนี้
ตัวอย่าง |
คำขอ (API 1) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.setOptions",
"parameters": {
"sessionId": "12ABC3",
"iso": 200,
"exposureCompensation": -2,
"captureMode": "_video"
}
} |
การตอบกลับ |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera.setOptions",
"state": "done"
} |
คำขอ |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera._startRecording",
"parameters": {
"sessionId": "12ABC3",
...
}
} |
การตอบกลับ |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera._startRecording",
"state": "done"
} |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eThe Open Spherical Camera (OSC) API Specification starts with image support in API level 1 and adds video support in API level 2.\u003c/p\u003e\n"],["\u003cp\u003eCamera manufacturers can define custom commands and parameters, called Vendor Commands and Vendor Parameters, by prefixing them with an underscore (_).\u003c/p\u003e\n"],["\u003cp\u003eVendor-specific functionality can be implemented within the output of /osc/info and /osc/state APIs, as well as within OSC API commands and parameters.\u003c/p\u003e\n"],["\u003cp\u003eVendor Commands and Parameters must have alphanumeric names.\u003c/p\u003e\n"]]],["OSC API level 1 supports images, while level 2 adds video. Manufacturers can define custom commands and parameters (Vendor Commands/Parameters), which must be alphanumeric and prefixed with an underscore. Vendor-specific functionality can be found in the output of /osc/info and /osc/state APIs, in the commands for /osc/commands/execute, and in command parameters. Examples demonstrate `setOptions` with vendor-specific parameter `_video`, and a vendor-specific command, `_startRecording`.\n"],null,["# Vendor-Specific\n\nAPI level 1 of the OSC API Specification focuses on image type, and video support is added in API level 2. Camera manufacturers are encouraged to define custom commands and/or extend the parameter set of standard commands if needed. These are known as *Vendor Commands* and *Vendor Parameters*.\n\nThe name of the Vendor-specific commands and parameters must be alphanumeric and prefixed with an underscore ( _ ).\n\nVendor-specific functionality can happen in four places as follows:\n\n- [Output](/streetview/open-spherical-camera/guides/osc/info#output) of /osc/info API\n- [Output](/streetview/open-spherical-camera/guides/osc/state#output) of /osc/state API\n- [OSC API Specification](/streetview/open-spherical-camera/reference/camera), commands for /osc/commands/execute\n- [OSC API Specification](/streetview/open-spherical-camera/reference/camera), command parameters; for example, parameters for the `setOptions` and `getOptions` commands.\n\n| Example ------- ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Request (API 1)** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera.setOptions\", \"parameters\": { \"sessionId\": \"12ABC3\", \"iso\": 200, \"exposureCompensation\": -2, \"captureMode\": \"_video\" } } ``` |\n| **Response** | ```http HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { \"name\": \"camera.setOptions\", \"state\": \"done\" } ``` |\n| **Request** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera._startRecording\", \"parameters\": { \"sessionId\": \"12ABC3\", ... } } ``` |\n| **Response** | ```http HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { \"name\": \"camera._startRecording\", \"state\": \"done\" } ``` |"]]