add eHDR controls
This commit is contained in:
221
SOCKET_API.md
221
SOCKET_API.md
@@ -433,6 +433,168 @@ Adjust camera gain.
|
||||
|
||||
---
|
||||
|
||||
### 15. Set eHDR Mode
|
||||
|
||||
Enable or disable eHDR (Enhanced High Dynamic Range) mode.
|
||||
|
||||
**Note:** eHDR features are only available on specific camera models: VCI-AR0821/AR0822, VCS-AR0821/AR0822, VLS3-AR0821/AR0822, VLS-GM2-AR0821/AR0822, and TEVS-AR0821/AR0822.
|
||||
|
||||
**Command:**
|
||||
```json
|
||||
{
|
||||
"command": "set_ehdr_mode",
|
||||
"params": {
|
||||
"mode": "0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `mode`: "0" to enable eHDR, "1" to disable eHDR
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"message": "eHDR mode set successfully"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 16. Set eHDR Exposure Minimum
|
||||
|
||||
Set the minimum number of exposure frames for eHDR.
|
||||
|
||||
**Command:**
|
||||
```json
|
||||
{
|
||||
"command": "set_ehdr_exposure_min",
|
||||
"params": {
|
||||
"value": "1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `value`: Minimum exposure frames (range: 1-4, default: 1)
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"message": "eHDR exposure min set successfully"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 17. Set eHDR Exposure Maximum
|
||||
|
||||
Set the maximum number of exposure frames for eHDR.
|
||||
|
||||
**Command:**
|
||||
```json
|
||||
{
|
||||
"command": "set_ehdr_exposure_max",
|
||||
"params": {
|
||||
"value": "4"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `value`: Maximum exposure frames (range: 1-4, default: 4)
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"message": "eHDR exposure max set successfully"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 18. Set eHDR Ratio Minimum
|
||||
|
||||
Set the minimum exposure ratio for eHDR.
|
||||
|
||||
**Command:**
|
||||
```json
|
||||
{
|
||||
"command": "set_ehdr_ratio_min",
|
||||
"params": {
|
||||
"value": "12"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `value`: Minimum exposure ratio (range: 1-128, default: 12)
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"message": "eHDR ratio min set successfully"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 19. Set eHDR Ratio Maximum
|
||||
|
||||
Set the maximum exposure ratio for eHDR.
|
||||
|
||||
**Command:**
|
||||
```json
|
||||
{
|
||||
"command": "set_ehdr_ratio_max",
|
||||
"params": {
|
||||
"value": "24"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `value`: Maximum exposure ratio (range: 1-128, default: 24)
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"message": "eHDR ratio max set successfully"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 20. Get eHDR Status
|
||||
|
||||
Retrieve all current eHDR settings.
|
||||
|
||||
**Command:**
|
||||
```json
|
||||
{
|
||||
"command": "get_ehdr_status"
|
||||
}
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"ehdr_mode": 0,
|
||||
"exposure_min": 1,
|
||||
"exposure_max": 4,
|
||||
"ratio_min": 12,
|
||||
"ratio_max": 24
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Complete Workflow Example
|
||||
@@ -448,6 +610,13 @@ echo '{"command":"set_format","params":{"width":"1920","height":"1080","framerat
|
||||
echo '{"command":"set_exposure","params":{"mode":"auto"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"set_brightness","params":{"value":"50"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
|
||||
# 3a. (Optional) Configure eHDR settings (for compatible cameras)
|
||||
echo '{"command":"set_ehdr_mode","params":{"mode":"0"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"set_ehdr_exposure_min","params":{"value":"1"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"set_ehdr_exposure_max","params":{"value":"4"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"set_ehdr_ratio_min","params":{"value":"12"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"set_ehdr_ratio_max","params":{"value":"24"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
|
||||
# 4. Start streaming
|
||||
echo '{"command":"start_stream"}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
|
||||
@@ -499,6 +668,27 @@ echo '{"command":"get_status"}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"stop_stream"}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
```
|
||||
|
||||
### eHDR Control Examples
|
||||
|
||||
```bash
|
||||
# Enable eHDR mode
|
||||
echo '{"command":"set_ehdr_mode","params":{"mode":"0"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
|
||||
# Disable eHDR mode
|
||||
echo '{"command":"set_ehdr_mode","params":{"mode":"1"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
|
||||
# Configure eHDR exposure range
|
||||
echo '{"command":"set_ehdr_exposure_min","params":{"value":"1"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"set_ehdr_exposure_max","params":{"value":"4"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
|
||||
# Configure eHDR ratio range
|
||||
echo '{"command":"set_ehdr_ratio_min","params":{"value":"12"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
echo '{"command":"set_ehdr_ratio_max","params":{"value":"24"}}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
|
||||
# Get current eHDR settings
|
||||
echo '{"command":"get_ehdr_status"}' | socat - UNIX-CONNECT:/tmp/vizion_control.sock
|
||||
```
|
||||
|
||||
### Using `nc` (netcat with Unix socket support)
|
||||
|
||||
```bash
|
||||
@@ -535,6 +725,14 @@ print(send_command("set_format", {
|
||||
}))
|
||||
print(send_command("set_exposure", {"mode": "auto"}))
|
||||
print(send_command("start_stream"))
|
||||
|
||||
# eHDR control examples (for compatible cameras)
|
||||
print(send_command("set_ehdr_mode", {"mode": "0"})) # Enable eHDR
|
||||
print(send_command("set_ehdr_exposure_min", {"value": "1"}))
|
||||
print(send_command("set_ehdr_exposure_max", {"value": "4"}))
|
||||
print(send_command("set_ehdr_ratio_min", {"value": "12"}))
|
||||
print(send_command("set_ehdr_ratio_max", {"value": "24"}))
|
||||
print(send_command("get_ehdr_status")) # Get current eHDR settings
|
||||
```
|
||||
|
||||
### Using C++
|
||||
@@ -569,6 +767,13 @@ std::string sendCommand(const std::string& command) {
|
||||
int main() {
|
||||
std::cout << sendCommand(R"({"command":"get_formats"})") << std::endl;
|
||||
std::cout << sendCommand(R"({"command":"set_brightness","params":{"value":"50"}})") << std::endl;
|
||||
|
||||
// eHDR control examples (for compatible cameras)
|
||||
std::cout << sendCommand(R"({"command":"set_ehdr_mode","params":{"mode":"0"}})") << std::endl;
|
||||
std::cout << sendCommand(R"({"command":"set_ehdr_exposure_min","params":{"value":"1"}})") << std::endl;
|
||||
std::cout << sendCommand(R"({"command":"set_ehdr_exposure_max","params":{"value":"4"}})") << std::endl;
|
||||
std::cout << sendCommand(R"({"command":"get_ehdr_status"})") << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
@@ -587,6 +792,20 @@ The valid ranges for camera parameters depend on the specific camera model. You
|
||||
- Exposure: 1-10000 (in auto mode, value is ignored)
|
||||
- White Balance Temperature: 2800-6500 Kelvin
|
||||
|
||||
**eHDR ranges (for compatible cameras only):**
|
||||
- eHDR Mode: 0 (enable) or 1 (disable)
|
||||
- eHDR Exposure Min: 1-4 (default: 1)
|
||||
- eHDR Exposure Max: 1-4 (default: 4)
|
||||
- eHDR Ratio Min: 1-128 (default: 12)
|
||||
- eHDR Ratio Max: 1-128 (default: 24)
|
||||
|
||||
**Compatible eHDR Camera Models:**
|
||||
- VCI-AR0821/AR0822
|
||||
- VCS-AR0821/AR0822
|
||||
- VLS3-AR0821/AR0822
|
||||
- VLS-GM2-AR0821/AR0822
|
||||
- TEVS-AR0821/AR0822
|
||||
|
||||
## Error Handling
|
||||
|
||||
Always check the `status` field in the response:
|
||||
@@ -661,3 +880,5 @@ curl http://192.168.1.100:8080 > stream.mjpg
|
||||
- Invalid parameter values will return an error response
|
||||
- GStreamer pipeline errors will be reported when starting the stream
|
||||
- Default pipeline: `videoconvert ! autovideosink` (display locally)
|
||||
- eHDR features require compatible camera models (VCI/VCS/VLS3/VLS-GM2/TEVS-AR0821/AR0822)
|
||||
- eHDR settings may be reset to defaults when the camera starts streaming (driver behavior)
|
||||
|
||||
Reference in New Issue
Block a user