I'm trying to change the crop settings on the fly using the API. I tried this:
#!/usr/bin/python3
import json
import requests
s = requests.Session()
#Get Config
json_query = '{"command":"config", "subcommand":"getconfig"}'
response = requests.post("http://127.0.0.1:8090/json-rpc", data=json_query)
config = response.json()
# Modify the values directly in the config dictionary
config['info']['grabberV4L2']['cropTop'] = 20
config['info']['grabberV4L2']['cropBottom'] = 20
json_modify = {
"command": "config",
"subcommand": "setconfig",
"config": config
}
response = requests.post("http://127.0.0.1:8090/json-rpc", json=json_modify)
print(response.json())
When I run it, it gives a successful response, but the configuration breaks. I actually lose the grabber device. Did anyone accomplish something like this?
Can anyone help me?