Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onvif-cli more samples with working parameters - looking for howto focus #117

Open
jenswes opened this issue Oct 14, 2023 · 1 comment
Open

Comments

@jenswes
Copy link

jenswes commented Oct 14, 2023

Hello,

I'm trying to figure out howto translate the output of any onvif camera into a working onvif-cli commandline

so far i have: (if you have same more, please add here)

cmd devicemgmt GetCapabilities
cmd imaging GetImagingSettings {'VideoSourceToken': '000'}
cmd events GetEventProperties
cmd devicemgmt GetHostname
cmd devicemgmt GetWsdlUrl
cmd media GetProfiles

often i got a strange error like

cmd devicemgmt SetHostname {'Name': 'camo01', 'FromDHCP': True}
False: Unknown error: The Token type doesn't accept collections as value

ONVIF >>> cmd devicemgmt SetHostname {'Name': 'camo01'}
True: {}

ONVIF >>> cmd devicemgmt SetHostname {'FromDHCP': True}
False: Unknown error: The Token type doesn't accept collections as value

ONVIF >>> cmd devicemgmt GetHostname
True: OrderedDict([('FromDHCP', False), ('Name', 'camo01'), ('Extension', None), ('_attr_1', None)])

as the devicemgmt GetHostname has FromDHCP. i have an error setting this.

My goal would be adjusting zoom and fokus

From cmd media GetProfiles i have the profiles:

cmd imaging GetImagingSettings {'VideoSourceToken': '000'}

ONVIF >>> cmd imaging GetImagingSettings {'VideoSourceToken': '000'}
True: OrderedDict([('BacklightCompensation', OrderedDict([('Mode', 'OFF'), 
('Level', None)])), ('Brightness', 50.0), ('ColorSaturation', 50.0), ('Contrast', 50.0),
 ('Exposure', OrderedDict([('Mode', 'AUTO'), ('Priority', 'LowNoise'), 
('Window', OrderedDict([('bottom', 0.0), ('top', 0.0), ('right', 0.0), ('left', 0.0)])),
 ('MinExposureTime', 50.0), ('MaxExposureTime', 50.0), ('MinGain', 50.0),
 ('MaxGain', 50.0), ('MinIris', 50.0), ('MaxIris', 50.0), ('ExposureTime', 50.0),
 ('Gain', 50.0), ('Iris', 50.0)])), ('Focus', OrderedDict([('AutoFocusMode', 'AUTO'),
 ('DefaultSpeed', 5.0), ('NearLimit', 0.0), ('FarLimit', 100.0), ('Extension', None),
 ('_attr_1', None)])), ('IrCutFilter', 'AUTO'), ('Sharpness', 8.0), ('WideDynamicRange',

OrderedDict([('Mode', 'ON'), ('Level', 50.0)])), 
('WhiteBalance', OrderedDict([('Mode', 'AUTO'), ('CrGain', 50.0), ('CbGain',
 50.0), ('Extension', None), ('_attr_1', None)])), ('Extension', None), ('_attr_1', None)])

(offtopic, the output is ugly to read, any idea hot make it nicer?)

Here we have
('Focus', OrderedDict([('AutoFocusMode', 'AUTO'), ('DefaultSpeed', 5.0), ('NearLimit', 0.0), ('FarLimit', 100.0)

but how to construCt an onvif-cli

ONVIF >>> cmd imaging SetImagingSettings {'VideoSourceToken': '000'}
False: Unknown error: Missing element ImagingSettings (SetImagingSettings.ImagingSettings)

ONVIF >>> cmd imaging SetImagingSettings {'AutoFocusMode': 'manual'}
False: Unknown error: The ReferenceToken type doesn't accept collections as value

ONVIF >>> cmd imaging SetImagingSettings {'NearLimit': '30'}
False: Unknown error: The ReferenceToken type doesn't accept collections as value

i would be happy if someone is able to shine some light on this
thank you
:-)

@jenswes jenswes changed the title onvif-cli more samples with working parameters onvif-cli more samples with working parameters - looking for howto focus Oct 14, 2023
@zoldaten
Copy link

zoldaten commented Mar 4, 2024

media = mycam.create_imaging_service()
media.SetImagingSettings({'VideoSourceToken': '000', 'ImagingSettings':{'Focus': {
        'AutoFocusMode': 'MANUAL',
        'DefaultSpeed': 0.3,
        'NearLimit': 1.0,
        'FarLimit': 10.0,
        'Extension': None,
        '_attr_1': None
    }}})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants