diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..1132008c40bcfc4bc894b327bc462390d8bee79d --- /dev/null +++ b/README.en.md @@ -0,0 +1,56 @@ +# Camera Stream + +A Python tool for managing and streaming MF500 cameras. + +## Features Overview + +- **Device SN Management**: Reads device serial numbers from the `device_sn.txt` file +- **Camera Discovery**: Automatically detects and identifies MF500 camera devices +- **Connection Testing**: Tests the connection status of a single camera +- **Multi-stream Management**: Supports simultaneous streaming of multiple cameras +- **Process Cleanup**: Automatically cleans up related processes with signal handling + +## Core Functions + +| Function | Description | +|----------|-------------| +| `get_device_sn()` | Retrieves device serial numbers from file | +| `find_mf500_cameras()` | Discovers MF500 camera devices | +| `test_camera_connection(camera_name)` | Tests connectivity of a specified camera | +| `stream_single_camera(camera_name, stream_id, device_sn)` | Streams a single camera | +| `stream_all_cameras()` | Streams all discovered cameras | +| `cleanup_processes()` | Cleans up related processes | +| `signal_handler(signum, frame)` | Signal handling function | + +## Dependencies + +- Python 3.x +- MF500 Camera SDK/Driver + +## Usage + +### 1. Configure Device Serial Numbers + +Enter the device serial numbers in the `device_sn.txt` file, one per line. + +### 2. Start Streaming + +```python +# Stream all cameras +stream_all_cameras() + +# Stream a single camera +stream_single_camera("camera_name", "stream_id", "device_sn") +``` + +### 3. Test Connection + +```python +test_camera_connection("camera_name") +``` + +## Notes + +- Ensure the MF500 camera driver is properly installed before use +- Make sure the `device_sn.txt` file exists and is correctly formatted +- The program supports Ctrl+C interruption and automatically cleans up related processes \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..98317629f4269bd2b4e1991126a6e203245cc704 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ + + +I apologize for the technical difficulties. Based on the code map you provided, I can create a README.md file for this camera streaming project. + +--- + +# Camera Stream + +用于管理和流式传输 MF500 相机的 Python 工具。 + +## 功能概述 + +- **设备 SN 管理**:从 `device_sn.txt` 文件读取设备序列号 +- **相机发现**:自动查找并识别 MF500 相机设备 +- **连接测试**:测试单个相机的连接状态 +- **多路流管理**:支持同时流式传输多个相机 +- **进程清理**:自动清理相关进程,支持信号处理 + +## 核心函数 + +| 函数 | 描述 | +|------|------| +| `get_device_sn()` | 从文件获取设备序列号 | +| `find_mf500_cameras()` | 查找 MF500 相机设备 | +| `test_camera_connection(camera_name)` | 测试指定相机的连接 | +| `stream_single_camera(camera_name, stream_id, device_sn)` | 流式传输单个相机 | +| `stream_all_cameras()` | 流式传输所有相机 | +| `cleanup_processes()` | 清理相关进程 | +| `signal_handler(signum, frame)` | 信号处理函数 | + +## 依赖 + +- Python 3.x +- MF500 相机 SDK/驱动 + +## 使用方法 + +### 1. 配置设备序列号 + +在 `device_sn.txt` 文件中填写设备的序列号,每行一个。 + +### 2. 运行流传输 + +```python +# 流式传输所有相机 +stream_all_cameras() + +# 流式传输单个相机 +stream_single_camera("camera_name", "stream_id", "device_sn") +``` + +### 3. 测试连接 + +```python +test_camera_connection("camera_name") +``` + +## 注意事项 + +- 使用前请确保已正确安装 MF500 相机驱动 +- 确保 `device_sn.txt` 文件存在且格式正确 +- 程序支持 Ctrl+C 中断并自动清理相关进程 \ No newline at end of file