File: arv-genicam-test.py

package info (click to toggle)
aravis 0.8.34-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,028 kB
  • sloc: ansic: 38,758; xml: 1,384; python: 371; sh: 275; makefile: 60; javascript: 58; cpp: 6
file content (34 lines) | stat: -rw-r--r-- 786 bytes parent folder | download
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
#!/usr/bin/env python3

# SPDX-License-Identifier:Unlicense

#  If you have installed aravis in a non standard location, you may need
#   to make GI_TYPELIB_PATH point to the correct location. For example:
#
#   export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/opt/bin/lib/girepositry-1.0/
#
#  You may also have to give the path to libaravis.so, using LD_PRELOAD or
#  LD_LIBRARY_PATH.

import sys
import gi

gi.require_version ('Aravis', '0.8')

from gi.repository import Aravis

Aravis.enable_interface ("Fake")

try:
    if len(sys.argv) > 1:
            camera = Aravis.Camera.new (sys.argv[1])
    else:
            camera = Aravis.Camera.new (None)
except TypeError:
	print ("No camera found")
	exit ()

device = camera.get_device ()
genicam = device.get_genicam_xml ()

print (genicam)