OSC Module
osc
module for Insta360 is based on Open Spherical Camera API
specification.
Classes:
Name | Description |
---|---|
Client |
OSC (open spherical camera) client to interact with the camera. |
Client
Client for interacting with the camera using osc API specification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host |
str
|
IP address of the camera. |
'192.168.42.1'
|
timeout_sec |
float
|
Timeout in seconds for requests. |
10.0
|
logger |
Logger | None
|
A custom logger to use. |
None
|
Methods:
Name | Description |
---|---|
execute_command |
Execute a command on the camera. |
list_files |
List files on the camera. |
delete_files |
Delete files on the camera. |
download_file |
Download a file from the camera. |
delete_files(file_urls)
Delete files on the camera.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_urls |
list[str]
|
URLs of the files to delete. |
required |
Returns:
Type | Description |
---|---|
DeleteFilesResponse | ErrorResponse
|
Delete files response. |
Tip
file_urls
can be obtained from ListFilesResponse.
download_file(file_url, save_path)
Download a file from the camera.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url |
str
|
URL of the file to download. |
required |
save_path |
str
|
Path to save the file. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the download was successful, False otherwise. |
Tip
file_urls
can be obtained from ListFilesResponse.
execute_command(body)
Execute a command on the camera.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body |
dict
|
Command to execute as Python dictionary. |
required |
Returns:
Type | Description |
---|---|
Response
|
Deserialized JSON response from the camera. |
Note
This method is used internally by other methods to execute commands on the camera.
list_files(file_type=ListFileType.ALL, start_position=0, entry_count=10, max_thumb_size=None)
List files on the camera.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_type |
ListFileType
|
Type of files to list. |
ALL
|
start_position |
int
|
Start position of the list. |
0
|
entry_count |
int
|
Number of entries to list after start position. |
10
|
max_thumb_size |
int | None
|
Maximum thumbnail size. |
None
|
Returns:
Type | Description |
---|---|
ListFilesResponse | ErrorResponse
|
List files response. |
Note
start_position
will have no effect if the file type isListFileType.ALL
- Less than 20 entries should be requested at a time to avoid large responses that camera may not be able to handle.