Skip to content

Commit fa2d5a7

Browse files
committed
Update README
1 parent ea61286 commit fa2d5a7

1 file changed

Lines changed: 42 additions & 21 deletions

File tree

README.md

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,94 @@ A real-time camera streaming system built on a Raspberry Pi that integrates a cu
33

44
This project demonstrates end-to-end system design across kernel space and user space. It combines Linux interfaces (V4L2, IOCTL, MMAP) with concurrent data pipelines and computer vision inference.
55

6-
💡 **Additional Notes**
6+
💡 **Additional Notes**
77
Each key feature includes a link to **in-depth implementation notes** that describe how the module was designed and built.
88

9-
### 🌿 Branches
9+
## 🌿 Branches
1010
- `main` - Stable, fully integrated version of the project
1111
- `stream` - Core camera capture and MJPEG streaming pipeline
1212
- `stream_detect` - Streaming pipeline with on-device object detection
1313
- `gh-pages` - Generated documentation hosted via github pages
1414

15-
### 📝 Documentation
16-
The project includes **comprehensive Doxygen documentation** covering:
17-
- Modules
18-
- Functions
19-
- Classes and detailed usage
15+
## 📝 Documentation
16+
The project includes **comprehensive Doxygen documentation** covering modules, functions, classes and detailed usage.
2017

2118
👉 Explore the generated docs: [Doxygen Documentation](https://hajjsalad.github.io/RaspberryPi-Cam-Streamer/html/index.html)
2219
👉 Explore how the documentation was structured and written: [Notes on Notion](https://www.notion.so/hajjsalad/Doxygen-Documentation-2dea741b5aab809989afdaf9d198430b)
2320

2421
### 🗝️ Key Features
25-
**Custom Linux Kernel Module** [Notes on Notion](https://www.notion.so/hajjsalad/Cam-Stream-Kernel-Module-2cca741b5aab80e1bddbe204e5e99eae)
22+
1. **Custom Linux Kernel Module** [Notes on Notion](https://www.notion.so/hajjsalad/Cam-Stream-Kernel-Module-2cca741b5aab80e1bddbe204e5e99eae)
2623

2724
- Character device driver exposing camera control and LED status signaling via `ioctl`
2825
- Well-defined kernel ↔ user-space interface with minimal surface area
2926
- GPIO-driven LED indicators reflecting real-time camera streaming state
3027

3128
`GPIO` · `IOCTL` · `Character device` · `Linux kernel` · `kernel ↔ user space interface`
3229

33-
**V4L2-Based Camera Pipeline** [Notes on Notion](https://www.notion.so/hajjsalad/V4L2-Streaming-Pipeline-2cca741b5aab80be8b30e62d9311b929)
30+
2. **V4L2-Based Camera Pipeline** [Notes on Notion](https://www.notion.so/hajjsalad/V4L2-Streaming-Pipeline-2cca741b5aab80be8b30e62d9311b929)
3431

3532
- Camera configuration using V4L2 API, including format negotiation and stream parameters
3633
- Buffer allocation and zero-copy frame access via memory mapping I/O (MMAP)
3734
- Continuous frame capture with explicit buffer dequeue and re-queue operations
3835

3936
`V4L2` · `Camera drivers` · `MMAP` · `Buffer management` · `Video streaming`
4037

41-
**Multithreaded Producer-Consumer Architecture**
38+
3. **Multithreaded Producer-Consumer Architecture**
4239
- Dedicated producer thread captures frames from the camera pipeline
4340
- Consumer thread streams encoded frames to connected HTTP clients
4441
- Lock-protected circular buffer ensure safe, low-latency data exchange between threads
4542

4643
`Mutex` · `Semaphore` · `Circular buffers` · `Multithreading` · `Producer-consumer model`
4744

48-
**MJPEG HTTP Streaming** [Notes on Notion](https://www.notion.so/hajjsalad/MJPEG-HTTP-Streaming-2cca741b5aab80d9ab6beddf8d86db00)
45+
4. **MJPEG HTTP Streaming** [Notes on Notion](https://www.notion.so/hajjsalad/MJPEG-HTTP-Streaming-2cca741b5aab80d9ab6beddf8d86db00)
4946

50-
- Lightweight HTTP server
51-
- Multipart MJPEG streaming to browsers
47+
- Lightweight HTTP server for serving video streams
48+
- Multipart MJPEG streaming compatible with web browsers and MJPEG clients
5249

53-
**Real-Time Object Detection** [Notes on Notion](https://www.notion.so/hajjsalad/Object-Detection-2d2a741b5aab80ac958fc72ffb4de8a4)
54-
- TensorFlow Lite inference on captured frames
55-
- Designed for edge deployment
50+
`HTTP` · `MJPEG` · `Sockets` · `Lightweight server` · `Multipart streams`
51+
52+
5. **Real-Time Object Detection** [Notes on Notion](https://www.notion.so/hajjsalad/Object-Detection-2d2a741b5aab80ac958fc72ffb4de8a4)
53+
- Performs on-device inference using TensorFlow Lite on captured frames
54+
- Optimized for real-time edge deployment on the Raspberry Pi
55+
56+
`Edge AI` · `Object Detection` · `Embedded ML` · `TensorFlow Lite` · `Real-time Inference`
5657
---
5758
### 🧶 Threading Model
5859
- Producer Thread
59-
- Continously capture frames using V4L2
60-
- Creates the buffer
61-
- Converts raw frames and pushes them into a circular buffer
60+
- Continously capture frames from the camera using V4L2
61+
- Converts raw frames to JPEG and pushes them into a circular buffer
6262
- Signals frame availability using a semaphore
6363
- Consumer Thread
6464
- Waits on the semaphore for available frames
6565
- Retrieves JPEG frames from the circular buffer
6666
- Streams JPEG frames to connected HTTP clients
67-
- Frees the buffer
67+
- Frees the memory of the processed frames
6868

6969
This design allows for **producer thread** to run continously, while a new **consumer thread** is spawned per client.
7070

7171
### 🏗️ High Level Flow
72-
![Block Diagram](./Pi_cam_stream_Block_diagram.png)
72+
![Block Diagram](./Pi_cam_stream_Block_diagram.png)
73+
74+
# Program Flow Explanation
75+
```
76+
main.c (Program Entry Point)
77+
├─> Initialize camera module (opens custom kernel module)
78+
├─> Start HTTP server for MJPEG streaming
79+
└─> Initialize threading pipeline
80+
81+
Producer Thread
82+
├─> Capture frames from the camera (YUYV format)
83+
├─> Convert YUYV → RGB
84+
├─> Optional: Perform object detection on RGB frames
85+
├─> Convert RGB → JPEG
86+
└─> Push JPEG frames into circular buffer
87+
88+
Consumer Thread
89+
├─> Retrieve JPEG frames from circular buffer
90+
└─> Stream frames over HTTP (MJPEG)
91+
92+
├─> Display stream in browser
93+
```
7394
---
7495
### ⚙️ Hardware
7596
- **Raspberry Pi 5** - primary embedded platform for kernel and user-space execution

0 commit comments

Comments
 (0)