Skip to content

Commit d2ebd0b

Browse files
committed
Add an IP camera example
1 parent f4574c3 commit d2ebd0b

File tree

12 files changed

+2125
-0
lines changed

12 files changed

+2125
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Python cache files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Log files
7+
*.log
8+
9+
# Test files
10+
test_*.py
11+
*_test.py
12+
13+
# IDE files
14+
.vscode/
15+
.idea/
16+
*.swp
17+
*.swo
18+
19+
# OS files
20+
Thumbs.db
21+
.DS_Store
22+
23+
# Temporary files
24+
*.tmp
25+
*.temp
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# USB Camera to IP Camera
2+
3+
A complete solution for transforming your USB camera into an IP camera with both web access and a professional desktop client! This system includes a Python server that streams video from any USB camera over your local network, plus a modern GUI client for viewing and managing camera streams.
4+
5+
## 📋 Requirements
6+
7+
- **Python**: 3.7 or higher
8+
- **Hardware**: USB camera connected to your PC
9+
10+
## 🛠️ Installation
11+
12+
1. **Clone or download** this repository
13+
2. **Install server dependencies**:
14+
```bash
15+
pip install -r requirements.txt
16+
```
17+
3. **Install GUI client dependencies**:
18+
```bash
19+
cd gui_client
20+
pip install -r requirements.txt
21+
```
22+
23+
## 🎯 Quick Start
24+
25+
### 1. Start the IP Camera Server
26+
27+
```bash
28+
python ip_camera_server.py
29+
```
30+
31+
The server will:
32+
- Detect your USB camera automatically
33+
- Start streaming on port 5000
34+
- Display access URLs in console
35+
- Create a web interface at `http://localhost:5000`
36+
37+
### 2. Access Your Camera
38+
39+
#### Option A: Web Browser
40+
- **Local**: `http://localhost:5000`
41+
- **Network**: `http://YOUR_IP_ADDRESS:5000`
42+
43+
#### Option B: GUI Client
44+
```bash
45+
cd gui_client
46+
python main.py
47+
```
48+
49+
Then:
50+
1. Click "Connect to Camera" or press Ctrl+O
51+
2. Enter connection details:
52+
- **IP Address**: `localhost` (or your PC's IP)
53+
- **Port**: `5000`
54+
- **Stream Path**: `/video_feed`
55+
3. Click "Connect" to start streaming
56+
57+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"camera_index": 0,
3+
"host": "0.0.0.0",
4+
"port": 5000,
5+
"resolution": [
6+
1280,
7+
720
8+
],
9+
"fps": 30,
10+
"auto_reconnect": true,
11+
"log_level": "INFO",
12+
"stream_settings": {
13+
"enable_timestamp": true,
14+
"timestamp_color": [
15+
0,
16+
255,
17+
0
18+
],
19+
"timestamp_font_scale": 0.7,
20+
"timestamp_thickness": 2
21+
},
22+
"camera_settings": {
23+
"brightness": null,
24+
"contrast": null,
25+
"saturation": null,
26+
"exposure": null
27+
},
28+
"network": {
29+
"max_connections": 10,
30+
"buffer_size": 1024,
31+
"timeout": 30
32+
}
33+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"video_settings": {
3+
"fit_mode": 0,
4+
"show_overlay": true,
5+
"auto_reconnect": true,
6+
"reconnect_delay": 3
7+
},
8+
"connection_settings": {
9+
"timeout": 10,
10+
"buffer_size": 1024,
11+
"user_agent": "IP-Camera-GUI-Client/1.0",
12+
"retry_attempts": 3
13+
},
14+
"interface_settings": {
15+
"always_on_top": false,
16+
"start_fullscreen": false,
17+
"save_window_position": true,
18+
"theme": "system",
19+
"language": "en"
20+
},
21+
"recent_connections": [],
22+
"application": {
23+
"name": "IP Camera Viewer",
24+
"version": "1.0.0",
25+
"author": "IP Camera Tools",
26+
"description": "Professional desktop application for viewing IP camera streams"
27+
}
28+
}

0 commit comments

Comments
 (0)