Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Building a Video Surveillance System with GB28181-WVP

Tech 1

Creating a video surveillance system remains highly relevant across various sectors including railways, manufacturing plants, and retail stores. This guide walks through setting up such a system using the open-source GB28181-WVP project.

The required setup includes Ubuntu 20 or higher, JDK 8 or newer, Maven 3.3 or above, MySQL 8 or later, Redis 5 or greater, and a camera compliant with the GB28181 standard. All components must reside within the same local network.

For installation steps, root privileges are necessary; it's advisable to switch to the root user before proceeding.

Compiling and Running ZLMediaKit

  1. Install dependencies:
apt-get install build-essential
cmake
libssl-dev
  1. Fetch ZLMediaKit source:
cd /usr/local/
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit
cd ZLMediaKit
git submodule update --init
  1. Compile ZLMediaKit:
mkdir build
cd build
cmake ..
make -j4
  1. Launch ZLMediaKit:
cd ./release/linux/Debug
# Start as daemon
./MediaServer -d &

Once completed, ZLMediaKits ready for use. Proceed with compiling and launching WVP.

Building GB28181-WVP-PRO

  1. Retrieve WVP source:
cd /usr/local
git clone https://gitee.com/pan648540858/wvp-GB28181-pro.git
  1. Build frontend web application:
cd wvp-GB28181-pro/web_src/
npm --registry=https://registry.npm.taobao.org install
npm run build
  1. Compile WVP backend:
cd ../
mvn package

After successful compilation, a JAR file named wvp-pro-*.jar will appear in the target directory.

Setting Up MySQL Database

Create a database named wvp in MySQL and execute the SQL script located at wvp-GB28181-pro/sql/mysql.sql to initialize table structures.

Starting Redis

Simply initiate Redis service without further configuration.

Configuring WVP

  1. Modify configuration settings

Copy wvp-GB28181-pro/src/main/resources/application-dev.yml to the target directory.

Open application-dev.yml and adjust the following parameters:

Update Redis host addres to match your Redis server IP:

redis:
  host: 127.0.0.1

Adjust MySQL connection details:

url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true
username: root
password: 123456

Set SIP IP to your WVP server’s IP address:

sip:
  ip: 192.168.31.206

Define ZLMediaKit server IP:

media:
  id: FQ3TF8yT83wh5Wvz
  zlm:
    ip: 192.168.31.69

Launching WVP

Start the WVP service with:

java -jar -Dspring.config.location=/usr/local/wvp-GB28181-pro/target/application-dev.yml wvp-pro-*.jar

Integrating a GB28181 Camera

Ensure the camera supports GB28181 protocol and configure its SIP settings according to the WVP server's IP address and port.

CentOS Installation

For CentOS 7.7 environments:

  1. Install CMake version 3.1.3 or newer

Install required tools:

yum install gcc gcc-c++ ncurses-devel perl

Download and compile CMake:

yum install wget -y
wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz
mv cmake-3.3.2.tar.gz /usr/local/
tar zxvf cmake-3.3.2.tar.gz
cd cmake-3.3.2
./configure --prefix=/usr/local/
make
make install
mv cmake-3.3.2 cmake

Add to environment variables:

vi /etc/profile

Append these lines:

PATH=/usr/local/bin:$PATH
export PATH

Reload profile:

source /etc/profile
echo $PATH

Verify installation:

cmake --version
  1. Install ZLMediaKit:
git clone --depth 1 https://gitee.com/xiahcu/ZLMediaKit
cd ZLMediaKit
git submodule update --init

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.