telegenic
Pure-Rust GenICam camera library.
Transports are pluggable, but the only backend right now is GigE Vision
(telegenic::gige), which speaks GVCP (control) and GVSP (streaming)
directly over UDP.
use telegenic::{GenICamera, StreamConfig};
let mut cam = GenICamera::new([10, 0, 0, 210]);
cam.connect()?; // takes control and loads the feature model
cam.set_float("ExposureTime", 5000.0)?;
cam.set_enum("PixelFormat", "Mono8")?;
// Grab a single frame. The camera stays idle between captures,
// so this uses no stream bandwidth outside the snap itself.
let frame = cam.snap(StreamConfig::new(), std::time::Duration::from_secs(5))?;
println!("{}x{} {}", frame.width, frame.height, frame.pixel_format);
// Or stream continuously. The guard subscribes before the camera
// starts (so the first frame isn't lost) and stops it on drop.
let acq = cam.start_acquisition(StreamConfig::new())?;
while let Some(frame) = acq.wait_for(std::time::Duration::from_secs(1)) {
println!("{}x{} {}", frame.width, frame.height, frame.pixel_format);
}
acq.stop()?; // or just drop it
cam.disconnect(std::time::Duration::from_millis(500)); // or just drop it
# Ok::<(), telegenic::GenicamError>(())
A camera is a plain owned value. Constructing one does no I/O and can't
fail; connect(&mut self) is where the work happens, and it doubles as the
reconnect path after a dropped link. Everything tied to a connection
(identity, capabilities, the parsed GenICam model, stats) lives only as long
as the connection, and methods return Disconnected when no link is up.
Layers
GenICamera is the top-level type and the one most code uses. It parses the
device's GenICam XML (zipped or plain) and gives string-keyed typed access
to the feature node graph, including Converter/SwissKnife formula
evaluation, register caching, and pInvalidator handling. Acquisition is
built in: start_acquisition returns an RAII guard for continuous
streaming, and snap/snapshot_session grab single frames with the camera
idle in between. Both guards borrow the camera mutably, so stopping happens
automatically and disconnecting mid-acquisition won't compile.
Underneath sits the GigE Vision backend:
gige::discoverydoes broadcast device discovery per network adapter, and Force IP for repointing a camera whose address doesn't match the local subnet (seeexamples/discover.rsandexamples/force_ip.rs).gige::GigECamerais the GVCP transport. Register and memory IO return [ResponseHandle]s that can be waited on synchronously (wait_timeout) or.awaited. It handles the heartbeat, pending-acks, retries, and message-channel events, andopen_streamopens raw GVSP channels.gige::streamis the GVSP receiver, one thread per channel. Buffers come from a preallocated pool (no allocation per packet or frame at steady state), packets are reassembled out of order with resend requests, packet size is negotiated automatically, and frames fan out asArc<Frame>over bounded channels that drop when full.
Python
The same library ships as a Python package via PyO3/maturin (the py
feature). Install with pip install telegenicam once it's published, or run
maturin develop from a checkout; the import name is telegenic either
way. The GenICam surface maps one-to-one, blocking calls release the GIL,
and frames expose their pixels as bytes for numpy.frombuffer:
import telegenic
cam = telegenic.Camera("10.0.0.210")
cam.connect()
cam.set_float("ExposureTime", 5000.0)
with cam.snapshot_session() as session: # camera idle between snaps
frame = session.snap(timeout=5.0)
print(frame.width, frame.height, frame.pixel_format)
with cam.start_acquisition() as acq: # stops the camera again on exit
for _ in range(100):
frame = acq.wait_for(timeout=1.0)
if frame is not None:
print(frame)
telegenic.discover() finds cameras on the local subnets. The package
includes type stubs and docstrings (telegenic/__init__.pyi).
Examples
cargo run --example discover [interface-ip] # find cameras
cargo run --example force_ip <mac> <ip> <mask> <gw>
cargo run --example info <camera-ip> # identity + GenICam URL
cargo run --example snap <camera-ip> [n] # n on-demand single frames
cargo run --example grab <camera-ip> [n] # stream n frames
python examples/grab.py <camera-ip> [n] # the same, via the bindings
Testing
cargo test runs everything against an in-process fake camera over loopback
UDP (tests/fake_camera/). It covers GVCP semantics (retries, pending-ack,
control loss), discovery and Force IP, GVSP reassembly under packet loss,
reordering, and duplication with resend replay, GenICam evaluation against
the real Hikrobot and Imperx vendor XMLs in tests/data/, and the full
GenICamera path including message-channel events and single-frame
snapshots.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file telegenicam-1.0.3.tar.gz.
File metadata
- Download URL: telegenicam-1.0.3.tar.gz
- Upload date:
- Size: 257.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3787415f69bf5c877d1e4aed117ae7186e995610be164b2b6c64c220c66b6b73
|
|
| MD5 |
ef1786a8c2e39e5e75f74cb7c6e9eb91
|
|
| BLAKE2b-256 |
4789d5938eb684cea710683f545b1e79ce7307b30e4cc0cdd17b397b4f7db90c
|
File details
Details for the file telegenicam-1.0.3-cp315-abi3.abi3t-win_arm64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp315-abi3.abi3t-win_arm64.whl
- Upload date:
- Size: 506.4 kB
- Tags: CPython 3.15, CPython 3.15+, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72c8b3d2a97eaed407c4127144fcc0ca83a23ed861dfed6421f0db9549886ab5
|
|
| MD5 |
f863d3506873360a6da8d13f3e6a82b1
|
|
| BLAKE2b-256 |
46d5e9cfed058c999323bb60cc72595271052212bdd185f07a039a5711c1e05e
|
File details
Details for the file telegenicam-1.0.3-cp315-abi3.abi3t-win_amd64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp315-abi3.abi3t-win_amd64.whl
- Upload date:
- Size: 526.9 kB
- Tags: CPython 3.15, CPython 3.15+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e22f0d4e6db5b7e2ed299608a95257e508500cc7958d5760a5b7ccad0a2590f0
|
|
| MD5 |
ece158ca2c480ceb1010a5dbbb56e591
|
|
| BLAKE2b-256 |
8055d033f2103dc40c458e26c3c6e3c6c88f9497a4b485b3a575bc3f37449d32
|
File details
Details for the file telegenicam-1.0.3-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 682.5 kB
- Tags: CPython 3.15, CPython 3.15+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30320083edeed3934a757dbda705f90e2c60edc2c739252effc428d6c1535a86
|
|
| MD5 |
d3bdeaf17422504de9b1857b2bf0331f
|
|
| BLAKE2b-256 |
2c762e5433686aa91988eb07b83fbc12911e4ef103e426c4a62ef15b88596f52
|
File details
Details for the file telegenicam-1.0.3-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 680.3 kB
- Tags: CPython 3.15, CPython 3.15+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27b5d6f9abfc5c983f62e112deebed643510952d2f8276c4717b8c3d039813bf
|
|
| MD5 |
1dce975b7a9940d0633fdf8060658984
|
|
| BLAKE2b-256 |
12e52ec65681ac9e1e7af017db4d6b3367c571a5d20b417918e5aba38850c6e1
|
File details
Details for the file telegenicam-1.0.3-cp315-abi3.abi3t-macosx_11_0_arm64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp315-abi3.abi3t-macosx_11_0_arm64.whl
- Upload date:
- Size: 631.8 kB
- Tags: CPython 3.15, CPython 3.15+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d03baa0f8450f2d970bbaf7fcc71a35f6646a0ccefca71109928c93a30dab5f
|
|
| MD5 |
19370d939076384ef5cb3aa18728929f
|
|
| BLAKE2b-256 |
6b91a43a15cfe3e8694b2096bdf28e7b0c515b0280e8d7f67c87dffe796cee17
|
File details
Details for the file telegenicam-1.0.3-cp314-cp314t-win_arm64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp314-cp314t-win_arm64.whl
- Upload date:
- Size: 481.7 kB
- Tags: CPython 3.14t, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
295a69a65c35cbc262484ecccd6bca09414ea84152db6bd0bff7b45d9c984b36
|
|
| MD5 |
2634f682725a376805201fbb1594f9f0
|
|
| BLAKE2b-256 |
06c7d457e4d9c47f6cb9a8f9e9d7f46d4a57fce977e3925527d4ad876ce7ac16
|
File details
Details for the file telegenicam-1.0.3-cp314-cp314t-win_amd64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp314-cp314t-win_amd64.whl
- Upload date:
- Size: 495.0 kB
- Tags: CPython 3.14t, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27716926921573cbe1af73aa01fa8495637ef0b16472fe32f1805aa2a67d88cb
|
|
| MD5 |
b678920d556bad9ad6f3c1e87e6e2e36
|
|
| BLAKE2b-256 |
36247022fe85c4207db5c4162f403818103e800553a79967fe9f8fa3e2a8ae8d
|
File details
Details for the file telegenicam-1.0.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 654.3 kB
- Tags: CPython 3.14t, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bd4a49af8f34d60d00c857f77020ea507ede978f6f23c910ec8dfca3295a282
|
|
| MD5 |
7039d7affa3f62bf8e721a051c3d5570
|
|
| BLAKE2b-256 |
a076ad42c1098cd68170b7f3eeb8ef648572dd55d9dcfa86d394149f9cc3c3f7
|
File details
Details for the file telegenicam-1.0.3-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 659.0 kB
- Tags: CPython 3.14t, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d93792c66a80dc605a7c99a110d219d62a935d133e73303feaff57fd73e53c21
|
|
| MD5 |
4d06d021319ad66f6231ba3fde7d18a9
|
|
| BLAKE2b-256 |
040a69bb35fc73fda3747ad7e3fa6a804d23166fd5ec1b30a632795112d8f2a3
|
File details
Details for the file telegenicam-1.0.3-cp314-cp314t-macosx_11_0_arm64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp314-cp314t-macosx_11_0_arm64.whl
- Upload date:
- Size: 610.4 kB
- Tags: CPython 3.14t, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5367f2c60f9c97f9c93b61febe7e9cb905414783a4b600628b5ee154db1c60d6
|
|
| MD5 |
bd8393d265ba8bab457996b46cfbbe0a
|
|
| BLAKE2b-256 |
3c03369b972f4d452ef5a7e398c01941e46f3dac265316b32d72654bac28f880
|
File details
Details for the file telegenicam-1.0.3-cp310-abi3-win_arm64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp310-abi3-win_arm64.whl
- Upload date:
- Size: 489.0 kB
- Tags: CPython 3.10+, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38fb54fce2ccbe213063d3e4d9643b5cdfa24478fcf3fbbcbbc2f9bc50915532
|
|
| MD5 |
9d58975fff80113acb683d01ea774167
|
|
| BLAKE2b-256 |
109c80d1ec7a7c70a45f16eda87a6861067e4a6fb87e63c9978b65df9b4df186
|
File details
Details for the file telegenicam-1.0.3-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 501.9 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6701b7a0b371a751378005104621684294f59515d7bb040176d18fecc6b9d79a
|
|
| MD5 |
6d218c7e6999f3a080cf3649b1b772bc
|
|
| BLAKE2b-256 |
f504e53ae5a1ad84aed89e9b5a5f151f05ea59d77bd3affc12b666e8c00e4a63
|
File details
Details for the file telegenicam-1.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 661.6 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdc228518675f5eeba9616f412a21d9107d1f293fd1f869538429da7328e3075
|
|
| MD5 |
68c54d5690254aa6c24e71026070dc0c
|
|
| BLAKE2b-256 |
d92d23051aaa3685904de55e334951dc5823c787049f083c8dc57320a0c34f63
|
File details
Details for the file telegenicam-1.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 667.7 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
554481dc7002b8577201c31b5f806068e2a64404b5b6fe7a17d8ffde86d9bd94
|
|
| MD5 |
7b43967216b3d935f2d189a98a5b2fd5
|
|
| BLAKE2b-256 |
216296bde4e7947609260603150b84e71457c43fc64708f5881e5e25a45d3baf
|
File details
Details for the file telegenicam-1.0.3-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: telegenicam-1.0.3-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 619.9 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89c352a843b8c70aa40560ffcdd7d6fae74183a7e33816507b7a39f71c30b780
|
|
| MD5 |
3e7eef22194ff1cf3cc1969907502a35
|
|
| BLAKE2b-256 |
18e246142420d6a80c3dae2ecc27e7b251158ce6afaa2b902e4ec14666db0591
|