Skip to content

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.

Example
from insta360.osc import Client

client = Client()
response = client.delete_files([
    "http://192.168.42.1:80/DCIM/Camera01/VID_20240413_051305_00_031.insv",
    "http://192.168.42.1:80/DCIM/Camera01/VID_20240413_051251_00_030.insv"
])
print(response.model_dump())

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.

Example
from insta360.osc import Client

client = Client()
result = client.DownloadCameraFile(
    "http://192.168.42.1:80/DCIM/Camera01/LRV_20240411_074704_11_029.lrv",
    "C:/Users/username/Downloads/LRV_20240411_074704_11_029.lrv"
)
print(result)

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
  1. start_position will have no effect if the file type is ListFileType.ALL
  2. Less than 20 entries should be requested at a time to avoid large responses that camera may not be able to handle.
Example
from insta360.osc import Client

client = Client()
files = client.list_files(entry_count=2)
print(files.model_dump())