Camera Controls
這一頁還沒有中文版,以下顯示英文原文。
Change image controls, such as brightness and contrast, while the camera runs. This works only for libcamera cameras on a Raspberry Pi.
The controls apply only after the connection is up, so set them in onConnectionState. The full list of controls is CameraControlId.
import { CameraControlId, PiCamera } from '@mazupo/client';
const camera = new PiCamera({
uid: 'your-custom-uid',
mqttHost: 'your.mqtt.cloud',
mqttPath: '/mqtt',
mqttPort: 8084,
mqttUsername: 'hakunamatata',
mqttPassword: 'Wonderful',
stunUrls: ['stun:stun1.l.google.com:19302'],
});
camera.onConnectionState = (state) => {
if (state === 'connected') {
camera.setCameraControl(CameraControlId.BRIGHTNESS, 0.1);
camera.setCameraControl(CameraControlId.CONTRAST, 1.2);
}
};
camera.connect();Recording
Start and stop the device's recorder, and download recorded files. Both use the DataChannel, so they need the mqtt signaling.
IPC Messages
Send data to a program on the device, and receive its answers. The device must run pi-webrtc with --enable-ipc. pi-webrtc passes the messages to a Unix socke...

