Skip to main content

Documentation Index

Fetch the complete documentation index at: https://crsdk.app/llms.txt

Use this file to discover all available pages before exploring further.

Camera control is available through manager.camera(cameraId) (recommended) or manager.client. The bound camera accessor pre-binds the camera ID so you don’t need to pass it to every call.

Properties

Read properties

const cam = manager.camera(cameraId);

// Single property
const iso = await cam.getProperty('iso');
console.log(iso.data.formatted);  // "ISO 400"

// All properties
const all = await cam.getAllProperties();
console.log(all.properties);

Write properties

const cam = manager.camera(cameraId);
await cam.setProperty('iso', { value: '800' });
await cam.setProperty('aperture', { value: 'f/2.8' });
await cam.setProperty('shutter-speed', { value: '1/250' });

Priority key

Required before changing settings or triggering actions in remote control mode:
await cam.setPriorityKey({ setting: 'pc-remote' });

Listening for property changes

Use the bound camera’s events to get notified when properties change on the camera:
cam.events.on('propertyChanged', async (data) => {
  console.log('Changed properties:', data.codes);
  // Re-read the updated values
  const updated = await cam.getAllProperties();
});

Actions

Shutter

// Single shot
await cam.triggerShutter();

// Continuous start/stop
await cam.triggerShutter({ action: 'down' });  // start burst
await cam.triggerShutter({ action: 'up' });    // stop burst

Focus

// Autofocus + capture
await cam.afShutter();

// Focus lock (half-press)
await cam.halfPress();

// Manual focus — negative = near, positive = far (1–7 speed)
await cam.focusNearFar({ step: -3 });  // near, medium
await cam.focusNearFar({ step: 7 });   // far, max speed

Zoom

await cam.controlZoom({ direction: 'in', speed: 'normal' });
await cam.stopZoom();

Live View

Live view is disabled by default in remote-transfer mode. You must call enableLiveView() before requesting frames.
There are two ways to consume live view frames:
getLiveViewFrame()LiveViewStream
TransportHTTP GETWebSocket
BehaviorReturns a single JPEG frame — you must poll continuouslyPushes frames automatically at ~15fps
EnvironmentBrowser + Node.jsNode.js only

HTTP polling (single frame)

getLiveViewFrame() returns one JPEG frame per call. Poll it in a loop to simulate a video stream:
await cam.enableLiveView();

const poll = setInterval(async () => {
  const frame = await cam.getLiveViewFrame();
  // frame is an ArrayBuffer containing JPEG data
}, 66); // ~15fps

WebSocket streaming (continuous)

LiveViewStream handles continuous frame delivery automatically:
import { LiveViewStream } from 'camera-remote-web-api/server';

const liveView = new LiveViewStream(`ws://localhost:${manager.getPort()}`, cameraId);
liveView.onFrame((jpeg: ArrayBuffer) => {
  console.log(`Frame: ${jpeg.byteLength} bytes`);
});

liveView.close();

OSD overlay

Enable on-screen display (exposure info, focus area, etc.) on live view frames:
await cam.enableOSD();
await cam.enableLiveView();

SD Card

List and download files from the camera’s SD card. Requires remote-transfer or contents connection mode.
// List files on slot 1
const { files } = await cam.listSDCardFiles(1);
console.log(`Found ${files.length} files`);

// Download a file
if (files.length > 0) {
  const file = files[0];
  await cam.downloadSDCardFile(1, file.content_id, file.file_id);
}

Download notifications

Listen for completed downloads via the bound camera’s events:
cam.events.on('downloadComplete', (data) => {
  console.log('File saved:', data.filename);
});

cam.events.on('transferProgress', (data) => {
  console.log(`Transfer: ${data.percent}%`, data.filename);
});

Save Settings

Configure where and how the server saves transferred files:
// Read current settings
const info = await cam.getSaveInfo();

// Update save settings
await cam.setSaveInfo({
  path: '/tmp/photos',
  prefix: 'IMG_',
  startNo: 1,
});