Term project for the Architecture of Computer Systems course
Exploration of the ways to optimize the video stream decoding algorithm, in particular on surveillance devices from Dahua Technology, through the implementation of appropriate software based on the Web Real-Time Communication (WebRTC) protocol, since the use of software from developers does not provide the desired delay in video transmission from a device in motion, which is critical for tasks related to video surveillance.
A software prototype based on the WebRTC protocol was developed for low-latency video streaming from a Dahua Technology surveillance camera to a web browser. The system consists of three main components: a camera stream sender, a signaling/server-exchanger module, and a browser-based client application for video playback.s
During the implementation, the RTSP video stream from the camera was integrated with a WebRTC transmission pipeline using GStreamer, which enabled direct low-latency delivery of the video stream to the client browser. In addition, a signaling mechanism based on WebSocket communication was implemented to establish and maintain the WebRTC connection between the sender and the viewer. A series of experiments was conducted to evaluate the behavior of the stream under different network conditions and camera configurations.
As a result of the optimization process, unnecessary processing stages and camera-side settings that introduced additional buffering and delay were reduced. The developed solution achieved an average end-to-end latency of approximately 100–200 ms, which demonstrated significantly more stable real-time performance compared to the original vendor software. The experiments also revealed several limitations of the camera itself, particularly latency growth during intensive movement and fluctuations caused by adaptive buffering mechanisms.
- Python 3
- GStreamer for Python
- Node.JS
- GCC/Clang
- IP-camera Dahua DH-IPC-HFW2249S-S-IL.
Install the dependencies written in dependencies.md and requirements.txt
Detailed setup and usage instructions, including the initialization and configuration of the camera in Dahua ConfigTool, the launch of the signaling server, and the execution of the streaming components, are provided in the Instruction.
Clone the repository
git clone https://github.com/luftboud/latencyReducer
Install the dependencies written in dependencies.md and requirements.txt
- Run the server
cd server/cpp
mkdir build
cd build
cmake ..
make
./server
- Run the client
cd webclient
npx serve .
<y>
- Open the client via localhost and click
start- to send a request to the websocket - Run the sender
cd sender
python<3> sender.py
latencyReducer/
├── sender/ connects to the IP-camera and sends videostream
├── server/ main channel of communication between sender(camera) and client
└── webclient/ webclient that displays the decoded video stream in the browser