### Example Command Error Output JSON Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/startsession Provides an example of a JSON response when a command fails, detailing the error code and a descriptive message, such as when the camera is already in exclusive use. ```JSON { "error": { "code": "cameraInExclusiveUse", "message": "Camera already in exclusive use, new session can't be started." } } ``` -------------------------------- ### Google Street View Open Spherical Camera API Level 1 JSON Examples Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/takepicture Provides JSON examples for command input, successful output, and error output for API Level 1 of the Google Street View Open Spherical Camera. This level requires a `sessionId` parameter. ```JSON { "parameters": { "sessionId": "12ABC3" } } ``` ```JSON { "results": { "fileUri": "file URI" } } ``` ```JSON { "error": { "code": "invalidParameterValue", "message": "Parameter sessionId doesn't exist." } } ``` -------------------------------- ### Google Street View Open Spherical Camera API Level 2 JSON Examples Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/takepicture Provides JSON examples for command input, successful output, and error output for API Level 2 of the Google Street View Open Spherical Camera. This level deprecates `sessionId` and uses `fileUrl` for output. ```JSON none ``` ```JSON { "results": { "fileUrl": "Absolute file URL" } } ``` ```JSON { "error": { "code": "disabledCommand", "message": "Command is currently disabled." } } ``` -------------------------------- ### Example Command Input for Listing Entries Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/listfiles Illustrates the JSON structure for a command input to list entries, specifying the desired number of entries (`entryCount`) and an optional maximum thumbnail size (`maxThumbSize`). ```JSON { "parameters": { "entryCount": 50, "maxThumbSize": 100 } } ``` -------------------------------- ### Example XMP Metadata Output for Panoramic Image Source: https://developers.google.com/streetview/open-spherical-camera/reference/header/example-psxmp This snippet presents a real-world example of XMP data for an equirectangular panoramic image, formatted as key-value pairs. It showcases the metadata typically extracted by tools like exiftool, providing insights into the image's characteristics, such as its projection type, cropped and full dimensions, capture timestamps, and the software used for its creation. ```APIDOC XMP Toolkit: XMP Core 5.1.2 Use Panorama Viewer: True Projection Type: equirectangular Cropped Area Image Height Pixels: 2,048 Cropped Area Image Width Pixels: 4,096 Full Pano Height Pixels: 2,048 Full Pano Width Pixels: 4,096 Cropped Area Top Pixels: 0 Cropped Area Left Pixels: 0 First Photo Date: 2014:05:18 01:04:29.237Z (UTC) Last Photo Date: 2014:05:18 01:06:28.544Z (UTC) Source Photos Count: 41 Pose Heading Degrees: 42.0 Largest Valid Interior Rect Left: 0 Largest Valid Interior Rect Top: 0 Largest Valid Interior Rect Width: 4,096 Largest Valid Interior Rect Height: 2,048 Creator Tool: Google ``` -------------------------------- ### API Command: Start Session Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/startsession Detailed documentation for the 'Start Session' command, which initiates a timed camera session, locking the camera to the client. It covers session management, deprecation status, return values, and potential errors. ```APIDOC Command: Start Session Purpose: Initiates a session that locks the camera to the requesting client and keeps it awake, timing out after a specified or default interval. Session Management: A new session can always be started, automatically closing any existing session. Deprecation: This command is deprecated in API level 2. Returns: A unique session ID and the confirmed timeout duration. Possible Errors: invalid parameter names or values, or the camera already being in exclusive use. Summary: The core action initiates a timed camera session, locking the camera to the client and ensuring it remains active. A new session is always permitted, automatically ending any existing session. The user can optionally specify a session timeout in seconds; otherwise, the camera sets a default. The output includes a unique session ID and the confirmed timeout. Errors can occur if parameter names or values are invalid. This command has been deprecated after API level 2. ``` -------------------------------- ### XMP Metadata Properties for 360 Video Source: https://developers.google.com/streetview/open-spherical-camera/reference/header/example-video-xmp This snippet illustrates the key XMP metadata properties for a 360 video, including its spherical nature, stitching status, the software used for stitching, and the projection type. It serves as an example of XMP output, though the Spherical Video v2 specification is recommended for new implementations. ```APIDOC Spherical: True Stitched: True StitchingSoftware: Spherical Metadata Tool Projection Type: equirectangular ``` -------------------------------- ### API Level 1 Command Input and Output Examples Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/setoptions Demonstrates the structure of command input, successful output, and error output for API Level 1. It shows how to specify `sessionId` and `options` with `isoBalance`, and the resulting error for an unsupported option. ```JSON { "parameters": { "sessionId": "12ABC3", "options": { "isoBalance": 200 } } } ``` ```text none ``` ```JSON { "error": { "code": "invalidParameterName", "message": "Parameter options contains unsupported option isoBalance." } } ``` -------------------------------- ### Open Spherical Camera Command Error Output JSON Example Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/updatesession This JSON snippet shows an example of an error response from the Open Spherical Camera API. It includes an `error` object with a `code` (e.g., `missingParameter`) and a human-readable `message` explaining the issue. ```JSON { "error": { "code": "missingParameter", "message": "Parameter sessionId is missing." } } ``` -------------------------------- ### Example Command Input JSON Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/startsession Illustrates a typical JSON structure for sending commands to the camera, specifically setting a timeout parameter for a session. ```JSON { "parameters": { "timeout": 50 } } ``` -------------------------------- ### Google Street View Open Spherical Camera API Level 1 Command I/O Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getoptions This snippet demonstrates the typical command input and output for API Level 1 of the Google Street View Open Spherical Camera. It includes an example of a successful request to retrieve camera options like `iso` and `isoSupport`, and a corresponding successful response. It also shows an example of an error response for an `invalidParameterName`. ```JSON { "parameters": { "sessionId": "12ABC3", "optionNames": [ "iso", "isoSupport" ] } } ``` ```JSON { "results": { "options": { "iso": 200, "isoSupport": [100, 200, 400, 800, 1600] } } } ``` ```JSON { "error": { "code": "invalidParameterName", "message": "Parameter optionNames contains unrecognized option XYZ." } } ``` -------------------------------- ### Example Command Input JSON Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/closesession Illustrates the JSON structure for providing input parameters to the command, specifically for the `sessionId`. ```json { "parameters": { "sessionId": "12ABC3" } } ``` -------------------------------- ### Google Street View Open Spherical Camera API Command Input and Output Examples Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/startcapture Illustrates the expected input and various output formats for commands in the Google Street View Open Spherical Camera API, including successful results with file URLs and error responses. ```APIDOC Command Input: none ``` ```JSON { "results": { "fileUrls":[ "url1", "url2", "url3", ... "urln" ] } } ``` ```JSON { "error": { "code": "disabledCommand", "message": "Command is currently disabled." } } ``` -------------------------------- ### Example Command Output for Listing Entries (Success) Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/listfiles Shows the JSON structure of a successful response when listing entries. It includes an array of `entries` with detailed file information and the `totalEntries` count. ```JSON { "results": { "entries": [ { "name": "abc", "fileUrl": "file URL", "size": 12345, "dateTimeZone": "2014:12:27 08:00:00+08:00", "lat": 50.5324, "lng": -120.2332, "width": 2000, "height": 1000, "thumbnail": "ENCODEDSTRING", "isProcessed": true, "previewUrl": "" } ], "totalEntries": 250 } } ``` -------------------------------- ### Open Spherical Camera API Command Input/Output Examples Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/stopcapture Provides examples of the expected input and output structures for commands in the Open Spherical Camera API, including successful data responses and error messages. ```APIDOC Command Input: none Command Output (Success): { "results": { "fileUrls":[ "url1", "url2", "url3", ... "urln" ] } } Command Output (Error): { "error": { "code": "disabledCommand", "message": "Command is currently disabled." } } ``` -------------------------------- ### API Reference: camera.getOptions Command Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getoptions Detailed API documentation for the `camera.getOptions` command, including its purpose, parameters, and expected results. This command returns the current settings for specified camera properties. It requires a session to be started via `camera.startSession`. ```APIDOC camera.getOptions: Description: Returns current settings for requested properties. API Level: Modified in API level 2. Prerequisite: Must call camera.startSession to obtain a unique session identifier. Parameters: sessionId: string Description: Unique session identifier obtained using the camera.startSession command. Note: This field was deprecated in API level 2. optionNames: String Array Description: A String Array of property names to return. Results: options: JSON pairs Description: JSON object containing the requested properties. Value Types: String, String Array, Number, Number Array, Boolean, Object, Object Array. Reference: See Options documentation. ``` -------------------------------- ### Example Command Output JSON (Success) Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/closesession Shows the expected output for a successful command execution, which is 'none'. ```json none ``` -------------------------------- ### Google OSC: Set Camera Options Command Examples Source: https://developers.google.com/streetview/open-spherical-camera/guides/osc/commands/execute Demonstrates how to set camera options using HTTP POST requests for the Google Open Spherical Camera. It includes examples for both API Level 1, which requires a `sessionId` parameter, and API Level 2, where `sessionId` is no longer needed. A successful HTTP 200 OK response is also provided. ```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", "options": { "iso": 200, "exposureCompensation": -2 } } } ``` ```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": { "options": { "iso": 200, "exposureCompensation": -2 } } } ``` ```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" } ``` -------------------------------- ### Example API Command Input for Image Listing Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/listimages Demonstrates the JSON structure for a command input to list images, specifying parameters like `entryCount` (number of entries to return), `maxSize` (maximum size of thumbnails), and `includeThumb` (whether to include thumbnails in the response). ```json { "parameters": { "entryCount": 50, "maxSize": 100, "includeThumb": true } } ``` -------------------------------- ### API Level 2 Command Input and Output Examples Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/setoptions Illustrates the command input, successful output, and error output for API Level 2. It shows the updated `options` structure without `sessionId`, including `iso` and `captureInterval`, and the error for using an API Level 2 option with an incompatible client version. ```JSON { "parameters": { "options": { "iso": 200, "captureInterval": 20 } } } ``` ```text none ``` ```JSON { "error": { "code": "invalidParameterName", "message": "Parameter options contains unsupported option captureInterval." } } ``` -------------------------------- ### Example: Image Retrieval Command Input JSON Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getimage Illustrates the JSON structure for providing input parameters to the image retrieval command. It includes the mandatory 'fileUri' and an optional 'maxSize' for image scaling. ```JSON { "parameters": { "fileUri": "file URI", "maxSize": 400 } } ``` -------------------------------- ### Google OSC: Take Picture Command Examples Source: https://developers.google.com/streetview/open-spherical-camera/guides/osc/commands/execute Illustrates how to initiate a picture capture using HTTP POST requests for the Google Open Spherical Camera. This snippet shows the API Level 1 request, which requires a `sessionId`, and the simplified API Level 2 request. It also includes an example of the asynchronous successful response, indicating the command is 'inProgress'. ```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.takePicture", "parameters": { "sessionId": "12ABC3" } } ``` ```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.takePicture" } ``` ```HTTP HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { "name": "camera.takePicture", "state": "inProgress", "id": "90ABCD", "progress": { "completion": 0 } } ``` -------------------------------- ### Google Street View Open Spherical Camera Command Output Example (Error) Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getmetadata Provides an example of the JSON structure for an error response, detailing the error `code` and `message` when a parameter value is invalid, such as a non-existent `fileUri`. ```JSON { "error": { "code": "invalidParameterValue", "message": "Parameter fileUri doesn't exist." } } ``` -------------------------------- ### Example Command Output JSON Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/startsession Shows the expected JSON response format for a successful command execution, including a session ID and the confirmed timeout duration. ```JSON { "results": { "sessionId": "12ABC3", "timeout": 50 } } ``` -------------------------------- ### Example Command Output for Listing Entries (Error) Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/listfiles Demonstrates the JSON structure of an error response. It indicates an `invalidParameterValue` error with a specific message, such as when `entryCount` is negative. ```JSON { "error": { "code": "invalidParameterValue", "message": "Parameter entryCount is negative." } } ``` -------------------------------- ### Example API Command Output for Image Listing Success Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/listimages Illustrates the successful JSON response structure for an image listing command. It includes an array of `entries` with details like name, URI, size, date/time, geographical coordinates, dimensions, and an optional thumbnail. It also provides `totalEntries` and a `continuationToken` for pagination. ```json { "results": { "entries": [ { "name": "abc", "uri": "image URI", "size": 1234567, "dateTimeZone": "2014:12:27 08:00:00+08:00", "lat": 50.5324, "lng": -120.2332, "width": 2000, "height": 1000, "thumbnail": "ENCODEDSTRING" }, { "name": "def", "uri": "another image URI", "size": 987654, "dateTimeZone": "2014:12:26 10:00:00+08:00", "lat": 51.0, "lng": -121.0, "width": 1920, "height": 1080, "thumbnail": "ANOTHERENCODEDSTRING" } ], "totalEntries": 250, "continuationToken": "50" } } ``` -------------------------------- ### Example Command Output JSON (Error) Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/closesession Demonstrates the JSON structure returned when an error occurs during command execution, specifically for an `invalidParameterValue` error. ```json { "error": { "code": "invalidParameterValue", "message": "Parameter sessionId type is incorrect." } } ``` -------------------------------- ### Google Street View Open Spherical Camera Command Input Example Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getmetadata Illustrates the JSON structure for a command input, specifically demonstrating how to specify a `fileUri` parameter for operations. ```JSON { "parameters": { "fileUri": "file URI" } } ``` -------------------------------- ### Open Spherical Camera Command Successful Output JSON Example Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/updatesession This JSON snippet demonstrates a successful response from the Open Spherical Camera API. It confirms the `sessionId` and the `timeout` value that was applied, indicating the command was processed as expected. ```JSON { "results": { "sessionId": "12ABC3", "timeout": 50 } } ``` -------------------------------- ### API: camera.startSession Command Reference Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/startsession Detailed API documentation for the `camera.startSession` command. This command starts a session that times out after a fixed interval, locking the camera to the requesting client and ensuring it stays awake. It is important to note that this command was deprecated in API level 2. If an existing session is active, the camera should automatically close it before starting a new one. ```APIDOC Method: camera.startSession Description: Starts a session that times out after a fixed interval. Locks the camera to the requesting client and makes sure the camera stays awake. Please note, starting a new session should always be allowed. If there is an existing session, it should be closed automatically by the camera before starting the new session. This command was deprecated in API level 2. Parameters: timeout: (Optional) Requested session timeout in seconds. If omitted (HTTP request has no body), the camera should determine a reasonable timeout. Results: sessionId: Unique session identifier of type string. timeout: Confirmed session timeout in seconds. ``` -------------------------------- ### Verify 360 Video Metadata with ffprobe Source: https://developers.google.com/streetview/open-spherical-camera/reference/header/video-xmp This command-line example demonstrates how to use `ffprobe` to inspect the metadata of a 360 video file. It shows how to confirm the presence of camera manufacturer, model, and firmware version information embedded within the video's metadata. ```Shell $ ffprobe your_video.mp4 ... Metadata: make : my.camera.make model : my.camera.model firmware : v_1234.4321 ... ``` -------------------------------- ### Open Spherical Camera Command Input JSON Example Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/updatesession This JSON snippet illustrates the structure for sending a command to the Open Spherical Camera API. It includes parameters such as `sessionId` for identifying the session and an optional `timeout` duration in seconds. ```JSON { "parameters": { "sessionId": "12ABC3", "timeout": 50 } } ``` -------------------------------- ### Example: Image Retrieval Command Error Output JSON Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getimage Shows the JSON structure returned when an error occurs during the image retrieval command. The 'error' object contains a 'code' identifying the error type and a descriptive 'message'. ```JSON { "error": { "code": "invalidParameterValue", "message": "Parameter fileUri doesn't exist." } } ``` -------------------------------- ### Example API Command Output for Error Response Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/listimages Shows the JSON structure for an API error response. It contains an `error` object with a `code` (e.g., 'invalidParameterValue') indicating the type of error and a `message` providing a human-readable description of the issue. ```json { "error": { "code": "invalidParameterValue", "message": "Parameter continuationToken is out of range." } } ``` -------------------------------- ### OSC Camera switchWifi Command for Internet Mode Setup Source: https://developers.google.com/streetview/open-spherical-camera/guides/direct-upload Details the `switchWifi` command used by the mobile app to configure an OSC camera for Internet mode. It specifies the required parameters for Wi-Fi credentials and certificate exchange, and the camera's response. ```APIDOC Command: switchWifi Purpose: Configure camera for Internet mode by providing Wi-Fi credentials and app's self-signed certificate. Parameters: - SSID: string (Infrastructure Wi-Fi access point identifier) - password: string (Password for the Wi-Fi access point) - app_self_signed_certificate: string (App's self-signed certificate for camera authentication) Camera Response: - camera_self_signed_certificate: string (Camera's self-signed certificate for app authentication) Notes: - Camera should store Wi-Fi credentials and app's certificate securely. - Camera should ideally store multiple Wi-Fi credentials. ``` -------------------------------- ### Google Street View Open Spherical Camera Command Output Example (Success) Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getmetadata Shows the JSON structure of a successful command output, including `exif` and `xmp` metadata such as image dimensions, projection type, and panorama viewer usage. ```JSON { "results": { "exif": { "ImageWidth": 2000, "ImageLength": 1000 }, "xmp": { "ProjectionType": "equirectangular", "UsePanoramaViewer": true } } } ``` -------------------------------- ### Google Street View Open Spherical Camera API Level 2 Command I/O Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/getoptions This snippet illustrates the command input and output for API Level 2 of the Google Street View Open Spherical Camera, highlighting the removal of the `sessionId` requirement. It provides examples of a successful request to retrieve camera options and its corresponding successful response, as well as an error response for an `invalidParameterName`. ```JSON { "parameters": { "optionNames": [ "iso", "isoSupport" ] } } ``` ```JSON { "results": { "options": { "iso": 200, "isoSupport": [100, 200, 400, 800, 1600] } } } ``` ```JSON { "error": { "code": "invalidParameterName", "message": "Parameter optionNames contains unrecognized option XYZ." } } ``` -------------------------------- ### Open Spherical Camera (OSC) API Video Header Specifications Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/processpicture Specifications for video metadata headers, specifically for 360 video, used in the Open Spherical Camera (OSC) API, including XMP examples. ```APIDOC Video Header: 360 Video Metadata 360 Video XMP Example ``` -------------------------------- ### OSC /osc/state API Request Example Source: https://developers.google.com/streetview/open-spherical-camera/guides/osc/state Demonstrates the HTTP POST request to the `/osc/state` endpoint, used to retrieve mutable camera status attributes such as battery level. The request includes standard headers for host, content type, and XSRF protection. ```HTTP POST /osc/state HTTP/1.1 Host: [camera ip address]:[httpPort] Accept: application/json X-XSRF-Protected: 1 ``` -------------------------------- ### Google Street View OSC Camera API Commands for Direct Upload Source: https://developers.google.com/streetview/open-spherical-camera/guides/direct-upload This section details the core API commands used by the mobile application to interact with the Open Spherical Camera (OSC) for the new direct upload workflow. Communication is based on HTTP 1.1, utilizes JSON data formats, and supports both GET and POST requests. These commands facilitate file listing, direct upload initiation, and progress monitoring. ```APIDOC API Interaction Overview: - Protocol: HTTP 1.1 - Data Format: JSON - Request Types: GET, POST Commands: - listFiles: Purpose: Query the camera for a list of available files (images/videos) stored on the device. Usage: The mobile app sends this command to retrieve content metadata from the camera before initiating an upload. - uploadFile: Purpose: Initiate the direct upload of a specified image or video from the camera to the Street View server. Usage: The mobile app sends this command to trigger the camera's internal upload process, eliminating the need for the mobile device to act as an intermediary. - status: Purpose: Poll the camera periodically to check the progress of an ongoing upload operation. Usage: The mobile app sends this command to monitor the status and completion of an upload initiated by the 'uploadFile' command. ``` -------------------------------- ### Open Spherical Camera (OSC) API Image Header Specifications Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/processpicture Specifications for image metadata headers used in the Open Spherical Camera (OSC) API, including standard Exif and Photo Sphere XMP formats with examples. ```APIDOC Image Header: Exif Exif Example Photo Sphere XMP Photo Sphere XMP Example ``` -------------------------------- ### camera.startCapture API Reference Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/startcapture Detailed API documentation for the `camera.startCapture` command, outlining its purpose, parameters, and expected results for both video and interval image capture modes. ```APIDOC camera.startCapture Description: Starts video capture or interval image capture depending on value of `captureMode` in [Options](/streetview/open-spherical-camera/reference/options). This command was added in API level 2. Parameters: - 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: - `captureNumber`: If equal to or larger than 0, determines if it's open ended. - `captureMode`, `captureInterval`, and `captureNumber` need to be set prior. - For video capture: - Only `captureMode` needs to be set to "video". - Can only be stopped by [camera.stopCapture](/streetview/open-spherical-camera/reference/camera/stopcapture) command. Results: - Open-ended capture (when captureMode == "video" or captureNumber == 0): - No results. - Non-open-ended interval capture: - `fileUrls`: A list of absolute URLs, pointing to image files for interval capture. - Note: This command doesn’t return `fileUrls` immediately since the capture takes `captureNumber` to complete. - Progress can be obtained by polling the camera periodically (e.g., after an estimated duration `time = captureInterval * (captureNumber - 1)`) using the [/osc/commands/status](/streetview/open-spherical-camera/guides/osc/commands/status) API. - `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. ``` -------------------------------- ### OSC API: Check Command Status Request and Response Example Source: https://developers.google.com/streetview/open-spherical-camera/guides/osc/commands/status Illustrates a POST request to the `/osc/commands/status` endpoint to check the status of a previously executed command, and the corresponding successful JSON response. This example shows how to use a command ID to retrieve the command's state and results. ```HTTP POST /osc/commands/status 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 { "id": "90ABCD" } ``` ```HTTP HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { "name": "camera.takePicture", "state": "done", "results": { "fileUri": "ABC.JPG" } } ``` -------------------------------- ### API Option: exposureDelay Source: https://developers.google.com/streetview/open-spherical-camera/reference/options Current delay between the `takePicture` command and when the exposure is started, in seconds. ```APIDOC exposureDelay: Number ``` -------------------------------- ### OSC API: Execute Vendor-Specific Command `_startRecording` Source: https://developers.google.com/streetview/open-spherical-camera/guides/vendor-specific This snippet illustrates the execution of a vendor-specific command, `camera._startRecording`, through the Open Spherical Camera (OSC) API. It presents an HTTP POST request to `/osc/commands/execute` containing a JSON body that invokes the custom command. The accompanying response confirms the successful processing of the vendor command. ```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", ... } } ``` ```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" } ``` -------------------------------- ### OSC Camera Discovery Protocol (mDNS/DNS-SD) Specification Source: https://developers.google.com/streetview/open-spherical-camera/guides/direct-upload Outlines the zeroconf-based discovery protocol for OSC cameras in Internet mode, requiring mDNS and DNS-SD compliance. It defines service instance naming conventions, mandatory TXT record fields, and announcement procedures. ```APIDOC Protocol: Zeroconf (mDNS/DNS-SD) Requirements: - Implement IPv4 Link-Local Addressing (RFC 3927) - Comply with mDNS (RFC 6762) - Comply with DNS-SD (RFC 6763) Service Instance Names: - : _osc._tcp - : local. (Note: trailing dot) - Full Service Instance Name Example: _osc._tcp.local. TXT Record Requirements: - Mandatory Key/Value Pairs: txtvers, ty, id - txtvers: - Key: txtvers - Value: 1 (e.g., txtvers=1) - Purpose: Allows for future updates to TXT version. - ty: - Key: ty - Value: User-readable camera name (e.g., ty=Google Street View Optimized Spherical Camera Model XYZ) - Purpose: Provides a human-friendly name for the camera. - id: - Key: id - Value: Unique camera identifier (e.g., id=A unique id of the camera) - Purpose: Provides a unique ID for the camera, must match /osc/info output's cameraId. Announcements: - On camera startup or shutdown, MUST perform announcement step as per mDNS specification. - SHOULD send corresponding announcement at least twice with at least a one-second interval. ``` -------------------------------- ### API Documentation for camera.takePicture Command Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/takepicture Comprehensive API reference for the `camera.takePicture` command, detailing its purpose, required parameters, and the structure of its results across different API levels. It highlights the deprecation of `sessionId` and the introduction of `fileUrl` in API level 2. ```APIDOC Command: camera.takePicture Description: Captures an equirectangular image, saving lat/long coordinates to EXIF (if camera features its own GPS or GPS is enabled on connected mobile phones). Call camera.setOptions prior to this command if needed. This command was modified in API level 2. Parameters: - sessionId: Type: string Description: Unique session identifier obtained from the camera.startSession command. This field was deprecated in API level 2. Results: - API level 1: - fileUri: Type: string Description: URI of the captured image. Manufacturers decide whether to use absolute or relative URIs (e.g., "http://android.com/robots.txt" vs. "robots.txt"). Clients may treat this as an opaque identifier. - API level 2: - fileUrl: Type: string Description: Absolute URL of the captured image, which can be used to download directly from the HTTP server of the camera. This command doesn’t return fileUrl immediately since the capture (including in-camera stitching) usually takes a while (seconds to minutes) to complete. The progress of the command is obtained by polling the camera periodically using the /osc/commands/status API and fileUrl is the result returned when the command finishes. When delayProcessing is true, it is the absolute URL of the preview image, which can be used as input in processPicture to process the image; otherwise, it is the absolute URL of the final processed image. ``` -------------------------------- ### API Reference: camera.setOptions Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/setoptions Detailed API documentation for the `camera.setOptions` command, including its purpose, parameters, and return values. Notes on its modification and deprecation status in API level 2 are also included. ```APIDOC camera.setOptions(sessionId: string, options: JSON) Description: Sets values for specified properties (e.g., GPS on/off, date & time, ISO, white balance, shutter speed, sleep/power-off delay). Note: This command was modified in API level 2. Prerequisite: Must call camera.startSession to obtain a unique session identifier before calling this command. This was deprecated in API level 2. Parameters: sessionId: Type: string Description: Unique session identifier, obtained using the camera.startSession command. This field was deprecated in API level 2. options: Type: JSON pairs Description: JSON pairs of the properties to set. The value can be any of the following types: String, String Array, Number, Number Array, Boolean, Object, Object Array. See Options. Results: No result. ``` -------------------------------- ### Google Street View Open Spherical Camera Options Reference Source: https://developers.google.com/streetview/open-spherical-camera/reference/options Comprehensive reference for all configurable options accessible via `camera.setOptions` and `camera.getOptions`. Each entry specifies the option's name, data type, a detailed description including default values and API level changes, and whether it is readable (r) or writable (w). ```APIDOC camera.setOptions / camera.getOptions: Options: - Name: captureMode Type: String Description: Current capture mode. Default to `image.` Read/Write: rw - Name: captureModeSupport Type: String Array Description: List of capture modes currently available. Minimum requirement for API level 1 is `["image"]`, and minimum requirement for API level 2 is `["image", "interval"]`, where `"interval"` represents the mode of capturing a series of images spaced at a certain interval, please see also `captureInterval` and `captureIntervalSupport`. Two additional modes `("video" and "walkaround")`are supported by API level 2, so the complete supported set by API level 2 is `["image", "interval", "video", "walkaround"]`, where `"video"` represents the video capture mode and `"walkaround"` represents the mode of capturing two images in sequence, the first with the users standing anywhere relative to the camera and the second with the users standing on the opposite side (relative to the first standing point) of the camera. This allows the camera to remove the users from the final image by combining the two images. When `"walkaround"` is supported by the camera and set to be the current capture mode, the client should expect to send two takePicture commands to the camera, where the response of the first command (when it finishes) indicates the camera is ready to take the second image while the second command should return the final image when it finishes. To add more capture modes not supported yet, please prefix vendor-specific modes with an underscore ( _ ). This option was modified in API level 2. Read/Write: r - Name: captureStatus Type: String Description: Current capture status. Default to `"idle"`. This is useful to determine the camera's status when it is first connected to an app. If the camera is in the middle of shooting a video, it may need to be stopped before commanded to do other things, e.g. another video shooting. This option was added in API level 2.1. Read/Write: rw - Name: captureStatusSupport Type: String Array Description: List of capture statuses currently available; By default, it should be `["idle", "shooting"]` if video shooting is supported. Other statues can be provided too, e.g. `"downloading"`. This option was added in API level 2.1. Read/Write: r - Name: exposureProgram Type: Number Description: Current exposure program. Read/Write: rw - Name: exposureProgramSupport Type: Number Array Description: List of exposure programs currently available; for example, `[0, 1, 2, 3, 4]`. Each integer represents a different exposure program: * 0 = Not defined * 1 = Manual * 2 = Normal program * 3 = Aperture priority * 4 = Shutter priority Select the following link to download further details about `[ExposureProgram](http://www.exiv2.org/Exif2-2.PDF)`. Note: Use 9 for “ISO priority” if needed. Read/Write: r - Name: iso Type: Number Description: Current ISO speed setting. Read/Write: rw - Name: isoSupport Type: Number Array Description: API level 1: List of ISO settings currently available; for example, `[100, 200, 400, 800,1600]` or `[]` when it is in `auto` mode. API level 2: List of ISO settings currently available; for example, `[0, 100, 200, 400, 800, 1600]`, where `0` represents `auto` mode. This option was modified in API level 2. Read/Write: r - Name: shutterSpeed Type: Number Description: Current shutter speed setting. Read/Write: rw - Name: shutterSpeedSupport Type: Number Array Description: API level 1: List of shutter speeds currently available; for example, `[0.067, 0.033, 0.017,0.008]` or `[]` when it is in `auto` mode. API level 2: List of shutter speeds currently available; for example, `[0, 0.067, 0.033, 0.017, 0.008]`, where `0` represents `auto` mode. This option was modified in API level 2. Read/Write: r - Name: aperture Type: Number Description: Current aperture setting, in f-stops. Read/Write: rw - Name: apertureSupport Type: Number Array Description: API level 1: List of aperture settings currently available, expressed in `f/number`; for example, `[1.4, 2, 2.8, 4, 5.6, 8, 11]` or `[]` when it is `auto` mode. API level 2: List of aperture settings currently available, expressed in `f/number`; for example, `[0, 1.4, 2, 2.8, 4, 5.6, 8, 11]`, where `0` represents `auto` mode. Read/Write: r - Name: whiteBalance Type: String Description: Current white balance setting; for example, `daylight`. Default to `auto`. Read/Write: rw ``` -------------------------------- ### Retrieve Camera Information: /osc/info API Request Source: https://developers.google.com/streetview/open-spherical-camera/guides/osc/info This snippet shows the HTTP GET request to the `/osc/info` endpoint to retrieve detailed information about the camera. It requires the camera's IP address and HTTP port. ```APIDOC GET /osc/info HTTP/1.1 Host: [camera ip address]:[httpPort] Accept: application/json X-XSRF-Protected: 1 ``` -------------------------------- ### Upload File via cURL Command Line Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/uploadfile This cURL command demonstrates how to simulate the `camera.uploadFile` operation from a computer's command line. It performs an HTTP POST request, including an authorization header and specifying the file to upload (`-T`) and the destination URL. ```Shell curl -X post -H "Authorization: Bearer accessToken" -T fileUrl uploadUrl ``` -------------------------------- ### camera.processPicture API Reference Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/processpicture Detailed documentation for the `camera.processPicture` command, including its input parameters and the structure of the asynchronous results. ```APIDOC camera.processPicture: Description: Processes images previously captured but not processed yet. API Level: 2 Parameters: - name: previewFileUrls type: string[] description: A list of URLs of unprocessed images. Use ["all"] to process all unprocessed images. Cannot be empty. If the camera has trouble processing any image, it ignores that URL and proceeds with others. Results: - name: previewToFinalFileUrls type: JSONObject description: A JSON object where each key is the absolute URL of a preview image, and its value is the corresponding final processed image URL. This command is asynchronous; results are obtained by polling the /osc/commands/status API. If connection is lost, clients can use listFiles or re-issue the command to get final URLs. ``` -------------------------------- ### API Error Codes and Descriptions Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/switchwifi Defines common error codes returned by the API, along with their descriptions and examples of scenarios that trigger them. These errors indicate issues such as missing parameters, unrecognized parameter names, or invalid parameter values. ```APIDOC missingParameter: Some parameter, for example, preSharedKey is missing. invalidParameterName: One or more input parameter names are unrecognized. invalidParameterValue: Input parameter names are recognized but one or more passed value are invalid. For example, the wifiPwd is passed in as an integer instead of a string. ``` -------------------------------- ### API Command Input and Output Structures Source: https://developers.google.com/streetview/open-spherical-camera/reference/camera/listfiles Defines the general JSON structures for API command requests and responses, covering both successful data retrieval and error scenarios with their respective fields and types. ```APIDOC Command Input Structure: parameters: object entryCount: integer (required) Description: The number of entries to retrieve. Example: 50 maxThumbSize: integer (optional) Description: The maximum size for thumbnails. Example: 100 Command Output Structure (Success): results: object entries: array of objects Description: A list of file entries. Properties: name: string fileUrl: string size: integer (bytes) dateTimeZone: string (ISO 8601 format, e.g., "YYYY-MM-DD HH:MM:SS[+/-]HH:MM") lat: float lng: float width: integer (pixels) height: integer (pixels) thumbnail: string (base64 encoded image data) isProcessed: boolean previewUrl: string totalEntries: integer Description: The total number of available entries. Command Output Structure (Error): error: object code: string Description: An error code indicating the type of error (e.g., "invalidParameterValue"). message: string Description: A human-readable description of the error (e.g., "Parameter entryCount is negative.") ``` -------------------------------- ### Open Spherical Camera API: Successful checkForUpdates Request/Response Source: https://developers.google.com/streetview/open-spherical-camera/guides/osc/checkforupdates Example of a successful `POST /osc/checkForUpdates` API call. The client sends its current `stateFingerprint` and `waitTimeout`, and the camera responds with a new `stateFingerprint` and a `throttleTimeout` indicating a state change. ```HTTP POST /osc/checkForUpdates HTTP/1.1 Host: [camera ip address]:[httpUpdatesPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { "stateFingerprint": "12EGA33", "waitTimeout": 300 } ``` ```HTTP HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { "stateFingerprint": "12EGA86", "throttleTimeout": 60 } ```