-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathset_imaging.py
More file actions
36 lines (30 loc) · 1.04 KB
/
Copy pathset_imaging.py
File metadata and controls
36 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
Path: examples/set_imaging.py
Author: @kaburagisec
Created: September 07, 2026
Tested devices: UNIVIEW Uho-S2E (https://www.uniarch.cn//Products/Wireless_Series/Basic_Series/Basic_Series/Uho-S2E-M4/)
This script connects to an ONVIF-compliant device and sets the Imaging settings
with defined parameters.
"""
from onvif import ONVIFClient
HOST = "192.168.1.3"
PORT = 80
USERNAME = "admin"
PASSWORD = "admin123"
try:
client = ONVIFClient(HOST, PORT, USERNAME, PASSWORD)
media = client.media()
profile = media.GetProfiles()[0] # use first profile
video_source_token = profile.VideoSourceConfiguration.SourceToken
imaging = client.imaging()
imaging.SetImagingSettings(
VideoSourceToken=video_source_token,
ImagingSettings={
"Brightness": 50.0,
"Contrast": 50.0,
"WideDynamicRange": {"Mode": "ON", "Level": 50.0},
},
)
print(imaging.GetImagingSettings(VideoSourceToken=video_source_token))
except Exception as e: # pylint: disable=broad-exception-caught
print(e)