Google은 AI 기술을 사용하여 콘텐츠를 사용자의 기본 언어로 번역합니다. AI 번역에는 오류가 있을 수 있습니다.
실행
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
/osc/commands/execute API는 카메라에서 지정된 명령어를 실행합니다. 출력은 명령 객체입니다.
| 이름 |
유형 |
설명 |
name |
문자열 |
실행할 명령어입니다. |
parameters |
객체 |
명령어 정의 사양에 따른 명령어 입력 매개변수입니다. 예시는 OSC API 사양을 참조하세요. |
출력
| 이름 |
유형 |
설명 |
name |
문자열 |
실행할 명령어입니다. |
state |
문자열 |
명령어 상태입니다. 다음 중 하나여야 합니다.
<ph type="x-smartling-placeholder"></ph>
done - 완료되었습니다. 이 응답에 결과가 반환되었습니다.
inProgress - 아직 실행이 진행 중입니다.
error - 실패했습니다. 응답의 오류를 확인하세요.
|
id |
문자열 (선택사항) |
명령어 ID. 이 값은 inProgress 상태를 반환하는 명령어에 필요합니다. 예를 들어 camera.takePicture 명령어는 병합이 필요하므로 몇 초가 걸립니다. 자세한 내용은 '상태' 섹션을 참조하세요. |
results |
객체 (선택사항) |
명령어 결과입니다. 명령어가 결과를 반환할 것으로 예상되는 경우 이 값은 done 상태를 반환하는 명령어에 필요합니다. 예를 들어
“results” : {
'AAA': 'BBB'
...
}
예시는 OSC API 사양을 참조하세요. |
error |
객체 (선택사항) |
명령어 오류 설명입니다. 이 값은 error; 상태를 반환하는 명령어에 필요합니다. 예를 들면 다음과 같습니다.
“error”: {
“code”: “missingParameter”
} |
progress |
객체 (선택사항) |
명령어 진행 설명 이 값은 inProgress 상태를 반환하는 명령어에 필요합니다. 예를 들어
“progress”: {
“completion”: 0.8
} |
오류
| 오류 코드 |
설명 |
unknownCommand |
요청된 명령어를 알 수 없습니다. 예: v2 클라이언트 (clientVersion이 2로 설정됨, 옵션 참고)가 API 수준 1에서 지원 중단된 명령어를 요청하면 이 오류 코드와 함께 요청이 실패합니다. |
disabledCommand |
실행된 명령어가 현재 사용 중지되어 있습니다. 예: `takePicture` 명령어는
카메라가 동영상 모드인 경우, 카메라가 delayProcessing을 지원하지 않으면 processPicture 명령이 비활성화됩니다. 이 오류 코드는 API 수준 2에 추가되었습니다. |
cameraInExclusiveUse |
카메라가 이미 독점적으로 사용 중이므로 새 세션을 시작할 수 없습니다. 이 오류 코드는 API 수준 2에서 지원 중단되었습니다. |
missingParameter |
하나 이상의 필수 매개변수가 지정되지 않았습니다. |
invalidParameterName |
하나 이상의 입력 매개변수 또는 옵션 이름을 인식할 수 없거나 지원되지 않습니다. |
invalidParameterValue |
매개변수 또는 옵션 이름을 인식했지만 하나 이상의 값이 잘못되었습니다. 예를 들어 값이 범위를 벗어납니다. |
예 |
| 요청 (API 1) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.setOptions",
"parameters": {
"sessionId": "12ABC3",
"options": {
"iso": 200,
"exposureCompensation": -2
}
}
} |
| 요청 (API 2) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.setOptions",
"parameters": {
"options": {
"iso": 200,
"exposureCompensation": -2
}
}
} |
| 응답 |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera.setOptions",
"state": "done"
} |
| 요청 (API 1) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.takePicture",
"parameters": {
"sessionId": "12ABC3"
}
} |
| 요청 (API 2) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.takePicture"
} |
| 응답 |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera.takePicture",
"state": "inProgress",
"id": "90ABCD",
"progress": {
"completion": 0
}
} |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2026-09-11(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2026-09-11(UTC)"],[],["The `/osc/commands/execute` API triggers commands on a camera, defined by a command `name` and associated `parameters`. The output indicates the command's `state` (`done`, `inProgress`, or `error`), an optional `id` for `inProgress` commands, `results` for completed commands, or `error` details. Possible errors include `unknownCommand`, `disabledCommand`, `missingParameter`, and `invalidParameterValue`. Example requests demonstrate how to set options and take a picture, with the responses showing command completion or ongoing progress.\n"]]