### 📄 [中文](README.zh.md) | 📄 [English](../README.md)
[Github](https://github.com/EternalNight996/hikvision-rs) | [Gitee](https://gitee.com/eternalnight996/hikvision-rs) | [crates.io](https://crates.io/crates/hikvision) | [Rust Doc](https://docs.rs/hikvision/0.1.6/hikvision/)
# ⚡ 这是什么?
**这是海康威视Camera Rust SDK,支持通用网络摄像头、通用USB摄像头、物联网摄像头和工业摄像头(USB、网络、CamL)**
### 支持 SDK
SDK |
Windows10 |
Unix |
- |
MVS |
√ |
X |
工业采集接口 (USB、CamL、GigE) |
NET |
√ |
X |
通用网络接口 |
USB |
X |
X |
通用USB接口 |
OTAP |
X |
X |
物联网开放访问协议 |
### SDK Support API
API |
MVS |
NET |
USB |
OTAP |
- |
Init SDK |
√ |
√ |
- |
- |
初始化SDK |
Enumerate |
√ |
X |
- |
- |
枚举设备 |
Login |
- |
√ |
- |
- |
登录设备 |
Open |
√ |
- |
- |
- |
打开设备 |
Handle |
√ |
√ |
- |
- |
创建句柄 |
Log |
√ |
√ |
- |
- |
日志输出 |
Clean SDK |
√ |
√ |
- |
- |
清理SDK |
Clean All |
√ |
√ |
- |
- |
清理所有 |
Destroy All |
√ |
√ |
- |
- |
销毁 |
Callback Sream |
√ |
√ |
- |
- |
回调数据流 |
Sream |
√ |
√ |
- |
- |
数据流 |
Fix Network |
√ |
X |
- |
- |
自适应网络传输大小 |
Preview |
√ |
√ |
- |
- |
预览图像 |
Capture Image |
√ |
√ |
- |
- |
抓图 |
Save JPEG |
√ |
√ |
- |
- |
存储JPEG格式 |
GUI |
√ |
√ |
- |
- |
图形化图像界面 |
# ✨ 分支
```toml
[features]
net = []
mvs = []
ui = ["e-utils/ui"]
default = []
```
# 📖 示例
```toml
[dependencies]
hikvision = {version="0.1", feature=["mvs","net","ui"]}
```
### Examples
[初始化 Mvs SDK](examples/global_mvs.rs) | [初始化 Net SDK](examples/global_net.rs)
## `💡!重要:`
#### xxx
1. [Env.json](Examples/Env.json) **环境变量; `{origin}` 是特殊的关键词,记录原始目录**
```json
{
"envs": [
{
"key": "HCNET_LIB",
"value": "{origin}/libs/HCNet/lib"
},
{
"key": "HCNET_COM_LIB",
"value": "{origin}/libs/HCNet/lib/HCNetSDKCom"
},
{
"key": "HCMVS_LIB",
"value": "{origin}/libs/HCMvs/Win64_x64"
}
]
}
```
1. 添加海康威视摄像头的链接库到hikvision-rs
```sh
# 把链接库放到 libs/HCMvs 或 libs/HCNet
cargo run --example global_mvs
cargo run --example global_net
```
1. 添加SDK Cargo.toml
```toml
[dependencies]
hikvision = {version="0.1", feature=["mvs","net"]}
```
# 🚀 快速运行
```sh
# test global mvs init sdk
cargo run --example global_mvs
# test global net init sdk
cargo run --example global_net
```
# 🦊 已运用项目
### 通过hikvision-rs开发的图形化界面;
### 通过海康威视摄像头抓图,上传日志和图像与MES系统
![test](../public/png/1.png)
# 🔭 为什么需要hikvision-rs?
# 🙋 参考项目与资料