lumeohq / onvif-rs

A native Rust ONVIF client library.
MIT License
114 stars 61 forks source link
onvif onvif-client rust

ONVIF-rs

ONVIF-rs is a Rust client library implementation of the ONVIF specification.

Features

Usage

Cargo.toml:

[dependencies]
onvif = { git = "https://github.com/lumeohq/onvif-rs" }

Troubleshooting

If you have an issue with OpenSSL build under Ubuntu, perform the following actions:

sudo apt install openssl1.0 libssl1.0.0 libssl1.0-dev
cargo clean
export OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
export OPENSSL_INCLUDE_DIR=/usr/include/openssl
cargo build

Examples

To discover devices on the local network:

cargo run --example discovery

To inspect and control a camera:

cargo run --example camera -- help

cargo run --example camera -- get-system-date-and-time \
    --uri=http://192.168.0.2:8000

cargo run --example camera -- set-hostname \
    --uri=http://192.168.0.2:8000 --username=admin --password=qwerty cam2

cargo run --example camera -- get-stream-uris --uri=http://192.168.0.2:8000

To pull events from a camera, adjust credentials in event.rs and run:

cargo run --example event

Dependencies

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT