Skip to content
/ gb28181 Public

基于GB28181-2022标准的NVR平台,同时支持 ONVIF/RTMP/RTSP 协议,集成 ZLMediaKit 处理流媒体,开箱即用。未来具备实时本地物体检测功能,适合注重隐私的私有化部署。

License

Notifications You must be signed in to change notification settings

gowvp/gb28181

Repository files navigation

English | 中文

GoWVP Logo

Version

Out-of-the-Box Video Surveillance Platform

GoWVP is an open-source GB28181 solution implemented in Go, a network video platform based on the GB28181-2022 standard that also supports 2016/2011 versions, with ONVIF/RTMP/RTSP protocol support.

Live Demo

Use Cases

  • Browser-based camera video playback without plugins
  • Support for GB28181-compliant devices (IP cameras, platforms, NVRs, etc.)
  • Support for non-GB28181 devices (RTSP, RTMP, streaming devices, etc.) - maximize your existing equipment
  • Cross-network video preview
  • Deployment via Docker, Docker Compose, or Kubernetes

Open Source Libraries

Thanks to @panjjo for the open-source library panjjo/gosip. GoWVP's SIP signaling is based on this library. Due to underlying encapsulation requirements, it's not a direct dependency but rather included in the pkg package.

Two streaming media servers are supported:

  • @夏楚 ZLMediaKit

  • lalmax-pro - For Go streaming media needs, contact email xx@golang.space

    • No environment requirements, no static library installation needed, cross-platform compilation support
    • Custom feature development available
    • G711 (G711A/G711U) to AAC transcoding support

Player uses @dexter's jessibuca

Project framework based on @ixugo's goddd

FAQ

Where are the frontend resources? How to load the web interface?

Click to download www.zip package

Download (packaged) frontend resources and place them in the project root directory, named www to load properly.

Any learning materials about the code?

GB/T28181 Open Source Diary[1]: Complete Practice from 0 to Implementing GB28181 Protocol

GB/T28181 Open Source Diary[2]: Setting Up Server, Solving CORS, API Integration

GB/T28181 Open Source Diary[3]: Building Monitoring Dashboard with React Components

GB/T28181 Open Source Diary[4]: Using ESLint for Development

GB/T28181 Open Source Diary[5]: Completing Forms with react-hook-form

GB/T28181 Open Source Diary[6]: Quick Integration of jessibuca.js Player in React

GB/T28181 Open Source Diary[7]: Implementing RTMP Authentication and Playback

GB/T28181 Open Source Diary[8]: Quick Guide to GB28181 Development

Any usage documentation?

RTMP

RTMP Push/Pull Stream Rules

How to Use OBS RTMP Push Stream to GB/T28181 Platform

Hikvision Camera RTMP Push Stream to Open Source GB/T28181 Platform

Dahua Camera RTMP Push Stream to Open Source GB/T28181 Platform

GB/T28181

7 Ways to Register GB28181 Devices

Black screen when playing

Check "Quick Desktop" - "ZLM settings button (top right)" - "GB28181 stream receiving default address" Ensure this address is accessible by the surveillance device.

Check "Quick Desktop" - "ZLM settings button (top right)" - "Hook IP" Can ZLM access GoWVP? For Docker combined version, use 127.0.0.1. For separate deployment, use explicit IP address.

Channel list shows fewer channels than actual count

By design. More than 4 channels should be viewed in the management page, or click "View More" on the right.

Using nginx reverse proxy, returned playback addresses don't work or snapshots don't load

Configure the following parameters in reverse proxy (replace domain with your actual one):

proxy_set_header X-Forwarded-Host $host;

proxy_set_header X-Forwarded-Prefix "https://gowvp.com";

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

Documentation

GoWVP Online API Documentation

ZLM Documentation github.com/ZLMediaKit/ZLMediaKit

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

You've made it this far!

Give us a ⭐ star!

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Docker

Video Guide

How to Build or Run the Project

How to Deploy with Docker Compose

Docker Hub

GoWVP & ZLMediaKit Combined Image (Recommended)

docker-compose.yml

services:
  gowvp:
    # If Docker Hub image is unavailable, try:
    # registry.cn-shanghai.aliyuncs.com/ixugo/homenvr:latest
    image: gospace/gowvp:latest
    restart: unless-stopped
    # For Linux, uncomment the line below and comment out all ports
    # network_mode: host
    ports:
      # gb28181
      - 15123:15123 # Management platform HTTP port
      - 15060:15060 # GB28181 SIP TCP port
      - 15060:15060/udp # GB28181 SIP UDP port
      # zlm
      - 1935:1935 # rtmp
      - 554:554 # rtsp
      - 8080:80 # http
      - 8443:443 # https
      - 10000:10000
      - 8000:8000/udp
      - 9000:9000/udp
      - 20000-20100:20000-20100 # GB28181 stream receiving ports
      - 20000-20100:20000-20100/udp # GB28181 stream receiving UDP ports
    volumes:
      # Log directory is configs/logs
      - ./data:/opt/media/bin/configs

GoWVP & ZLMediaKit Separate Images (More Complex Deployment)

services:
  gowvp:
    image: registry.cn-shanghai.aliyuncs.com/ixugo/gowvp:latest
    ports:
      - 15123:15123 # Management platform HTTP port
      - 15060:15060 # GB28181 SIP TCP port
      - 15060:15060/udp # GB28181 SIP UDP port
    volumes:
      # - ./logs:/app/logs # Uncomment if you need persistent logs
      - ./configs:/app/configs
    depends_on:
      - zlm
  zlm:
    image: zlmediakit/zlmediakit:master
    restart: always
    # Recommended: use host mode for Linux
    # network_mode: host
    ports:
      - 1935:1935 # rtmp
      - 554:554 # rtsp
      - 8080:80 # api
      - 8443:443
      - 10000:10000
      - 10000:10000/udp
      - 8000:8000/udp
      - 9000:9000/udp
      - 20000-20100:20000-20100
      - 20000-20100:20000-20100/udp
    volumes:
      - ./configs:/opt/media/conf

Quick Start

If you're a Go developer familiar with Docker, you can download the source code and run locally.

Prerequisites

  • Golang
  • Docker & Docker Compose
  • Make

Steps

  1. Clone this repository
  2. Modify WebHookIP in configs/config.toml to your LAN IP
  3. Run make build/linux && docker compose up -d
  4. A zlm.conf folder is auto-created. Get the API secret from config.ini and fill it in configs/config.toml under Secret
  5. Run docker compose restart
  6. Access http://localhost:15123 in your browser

How to Contribute?

  1. Fork this project
  2. Set your editor's run/debug output directory to the project root
  3. Make changes, submit a PR with description of modifications

Features

  • Out-of-the-box with web interface
  • RTMP stream distribution support
  • RTSP stream distribution support
  • Multiple protocol output: HTTP_FLV, Websocket_FLV, HLS, WebRTC, RTSP, RTMP
  • LAN/Internet/Multi-layer NAT/Special network environment deployment
  • SQLite database for quick deployment
  • PostgreSQL/MySQL database support
  • Auto offline/reconnect on service restart
  • GB/T 28181
    • Device registration with 7 connection methods
    • UDP and TCP signaling transport modes
    • Device time synchronization
    • Information queries support
      • Device catalog query
      • Device info query
      • Device basic config query (e.g., timeout 3s × 3 retries = ~9+x seconds for offline detection)
    • Live streaming from devices
    • UDP and TCP passive stream transport modes
    • On-demand streaming to save bandwidth (auto-stop after 30s without viewers)
    • H264 and H265 video codec support
    • g711a/g711u/aac audio codec support
    • Snapshots
    • CORS support
    • Chinese and English language support
    • ONVIF support
    • PTZ control
    • Recording playback
    • Alarm event subscription
    • Alarm event notification handling

Acknowledgments

Thanks to our sponsors (in no particular order):

@joestarzxh @oldweipro @beixiaocai

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

  • You are free to use, modify, and distribute the code of this project, subject to the following conditions:
  • Open Source Requirement: Any derivative works based on this project (including modified code or software integrating this project) must also be open-sourced under GPL-3.0.
  • Retain License & Copyright Notice: Derivative works must include the original project's LICENSE file and copyright notices.
  • Document Modifications: If you modify the code, you must indicate the changes in the files.

Note: If using this project for commercial closed-source software or SaaS services, you must comply with GPL-3.0's copyleft provisions (i.e., related code must be open-sourced).

For the complete license text, see the LICENSE file.

About

基于GB28181-2022标准的NVR平台,同时支持 ONVIF/RTMP/RTSP 协议,集成 ZLMediaKit 处理流媒体,开箱即用。未来具备实时本地物体检测功能,适合注重隐私的私有化部署。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •