// Save the buffer(addr) to a file
int fd = open("/data/output.jpg", O_CREAT | O_RDWR);
if (fd <= 0) {
std::cout << "cannot open /data/output.jpg\n";
}
int res = write(fd, addr, size);
if (res < 0) {
std::cout << "write error\n";
}
close(fd);
camera ready to open
camera open
create session
add input
format=2000, width=1280, height960
add output
ready to capture
image save
capture surface buffer end
capture finish
```
**【实际结果】:**
以下为远程摄像头拍摄的输出
```
# cameractl capture --cameraId=1
camera obj list size = 2
id=lcam001,
position=2,
cameraType=1,
connectionType=0