### Webhook Configuration Example Source: https://github.com/gowvp/owl/blob/main/README.md Configure webhook targets, retry attempts, buffer size, and the secret for receiving incoming requests. The secret is auto-generated on first launch. ```toml [Server.Webhook] # Target URL array; embed the secret as a query parameter Targets = [ "http://192.168.1.100:15123/webhook/events?secret=your-recv-secret", ] # Max retries, 0 = built-in default of 3 MaxRetry = 3 # Channel buffer size per target, 0 = built-in default of 64 BufferSize = 64 # Secret for validating incoming webhook requests (auto-generated on first launch) RecvSecret = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ``` -------------------------------- ### Database Configuration in config.toml Source: https://github.com/gowvp/owl/blob/main/README.md Modify the database connection string in the `configs/config.toml` file. Examples for SQLite, PostgreSQL, and MySQL are provided. ```toml # Recommended SQLite should be a local disk path, default is `configs/data.db` # Recommended PostgreSQL format: `postgres://postgres:123456@127.0.0.1:5432/gb28181?sslmode=disable` MySQL format: `mysql://root:123456@127.0.0.1:5432/gb28181?sslmode=disable` PostgreSQL and MySQL format pattern: `://:@:/?sslmode=disable` ``` -------------------------------- ### Initialize Jessibuca Player in React Source: https://github.com/gowvp/owl/wiki/GB-T28181-开源日记[6]:React-快速接入-jessibuca.js-播放器 Initializes the Jessibuca player using useEffect. Ensure the decoder path is correctly specified and handle potential re-initialization. The player can start playing if a stream link is provided. ```tsx useEffect(() => { // 播放器已经初始化,无需再次执行 if (p.current) { return; } const cfg: Jessibuca.Config = { container: divRef.current!, // 注意,这里很重要!! 加载解码器的路径 decoder: `${import.meta.env.VITE_BASENAME}assets/js/decoder.js`, debug: true, useMSE: true, isNotMute: true, showBandwidth: true, // 显示带宽 loadingTimeout: 7, // 加载地址超时 heartTimeout: 7, // 没有流数据,超时 videoBuffer: 0.2, isResize: true, operateBtns: { fullscreen: true, screenshot: true, play: true, audio: true, record: true, }, }; p.current = new window.Jessibuca(cfg); // 如果传入了播放链接,在加载播放器以后就可以播放了 if (link) { play(link); } return () => { console.log("🚀 ~ Jessibuca-player ~ dispose"); }; }, []); ``` -------------------------------- ### Build and Run GoWVP Locally with Docker Compose Source: https://github.com/gowvp/owl/blob/main/README.md This sequence of commands outlines the steps to build the GoWVP project for Linux and then run it using Docker Compose. It assumes prerequisites like Golang, Docker, and Make are installed. ```bash make build/linux && docker compose up -d ``` -------------------------------- ### Apply Player Component in Parent Source: https://github.com/gowvp/owl/wiki/GB-T28181-开源日记[6]:React-快速接入-jessibuca.js-播放器 Demonstrates how to use the Player component in a parent component. It shows the usage of `useRef` to get a handle on the player's control functions and how to manage the stream link and player lifecycle. ```tsx export type PlayerRef = { play: (link: string) => void; destroy: () => void; }; // ...... const playerRef = useRef(null); // 流地址 const [link, setLink] = useState(""); // 关闭弹窗,并销毁播放器 const close = () => { setOpen(false); playerRef.current?.destroy(); }; //......... {/* 播放器设置一个最小宽高 */}
``` -------------------------------- ### Webhook Event Receiver Source: https://github.com/gowvp/owl/blob/main/README.md Receives alert events pushed from external systems (like Python AI) or other GoWVP instances in a master-slave setup. Supports authentication via Basic Auth or a secret query parameter. ```APIDOC ## POST /webhook/events ### Description Unified event receiver for alert pushes. Compatible with Python AI integrations and GoWVP master-slave forwarding. ### Method POST ### Endpoint `/webhook/events` ### Parameters #### Query Parameters - **secret** (string) - Optional - Used for authenticating pushes from other GoWVP instances. #### Request Body (The payload format is described in the documentation, but a specific schema for the request body is not detailed here. See 'Forward Payload Format' for details on the structure of pushed events.) ### Request Example (Example payload provided in documentation under 'Forward Payload Format') ### Response #### Success Response (200) (No specific success response schema provided in the source) #### Response Example (No specific response example provided in the source) ### Authentication - **Basic Auth**: `Authorization: Basic ` header (for Python AI) - **Query Parameter**: `?secret=` (for other GoWVP instances) ``` -------------------------------- ### Nginx Reverse Proxy Configuration for Playback and Snapshots Source: https://github.com/gowvp/owl/blob/main/README.md Configure Nginx to correctly handle playback and snapshot URLs when using a reverse proxy. Ensure to replace the domain with your actual domain. ```nginx 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"; ``` -------------------------------- ### Docker Compose Configuration for GoWVP and ZLMediaKit Source: https://github.com/gowvp/owl/blob/main/README.md This configuration sets up GoWVP and ZLMediaKit services using Docker Compose. It specifies image, restart policy, network mode, port mappings for various protocols (GB28181, ONVIF, RTMP, RTSP), and volume mounts for data persistence. ```yaml 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 # HTTP: Web UI + ONVIF SOAP server - 3702:3702/udp # ONVIF WS-Discovery (能够被其它内网 onvif 发现本平台) - 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 - 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 ``` -------------------------------- ### Master Node Webhook Configuration Source: https://github.com/gowvp/owl/blob/main/README.md Configure the master node to push alerts to slave nodes via webhook. Ensure the slave node's IP and RecvSecret are correctly specified. ```toml # Master node config.toml [Server.Webhook] Targets = ["http://:15123/webhook/events?secret="] ``` -------------------------------- ### Play Stream Function for Jessibuca Source: https://github.com/gowvp/owl/wiki/GB-T28181-开源日记[6]:React-快速接入-jessibuca.js-播放器 Implements a function to play a video stream using the Jessibuca player. It includes checks to ensure the player is initialized and loaded before attempting to play, and handles potential playback errors. ```jsx const play = (link: string) => { console.log("🚀 Jessibuca-player ~ play ~ link:", link); if (!p.current) { console.log("🚀 Jessibuca-player ~ play ~ 播放器未初始化:"); toastError({ title: "播放器未初始化" }); return; } if (!p.current.hasLoaded()) { console.log("🚀 Jessibuca-player ~ play ~ 播放器未加载完成:"); toastError({ title: "播放器未加载完成" }); return; } p.current .play(link) .then(() => { console.log("🚀 Jessibuca-player ~ play ~ success"); }) .catch((e) => { toastError({ title: "播放失败", description: e.message }); }); }; ``` -------------------------------- ### Third-Party Authentication Configuration Source: https://github.com/gowvp/owl/blob/main/README.md Configure the `AuthURL` in `configs/config.toml` to point to your third-party authentication service. This is used for integrating with existing unified authentication systems. ```toml [Server.HTTP] AuthURL = "https://your-auth-server.com/api/verify" ``` -------------------------------- ### Slave Node Webhook Configuration Source: https://github.com/gowvp/owl/blob/main/README.md Configure the slave node to receive webhook pushes from a master node. The RecvSecret is auto-generated on first launch. ```toml # Slave node config.toml (RecvSecret is auto-generated on first launch) [Server.Webhook] RecvSecret = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ``` -------------------------------- ### Expose Player Control Functions via useImperativeHandle Source: https://github.com/gowvp/owl/wiki/GB-T28181-开源日记[6]:React-快速接入-jessibuca.js-播放器 Uses `useImperativeHandle` to expose the `play` and `destroy` functions to the parent component via a ref. This allows the parent to control the player's lifecycle and playback. ```tsx useImperativeHandle(ref, () => ({ play, destroy, })); ``` -------------------------------- ### ONVIF Device Service Endpoint Source: https://github.com/gowvp/owl/blob/main/README.md Provides access to ONVIF device services for managing and querying devices. This endpoint is used for Home Assistant integration and other ONVIF-compliant operations. ```APIDOC ## POST /onvif/device_service ### Description Endpoint for ONVIF device services, including device management and information retrieval. ### Method POST ### Endpoint `http://:15123/onvif/device_service` ### Parameters #### Request Body (No specific request body schema provided in the source) ### Request Example (No specific request example provided in the source) ### Response #### Success Response (200) (No specific success response schema provided in the source) #### Response Example (No specific response example provided in the source) ``` -------------------------------- ### Declare Jessibuca in Window Interface Source: https://github.com/gowvp/owl/wiki/GB-T28181-开源日记[6]:React-快速接入-jessibuca.js-播放器 Augments the global Window interface to include Jessibuca, resolving TypeScript errors related to accessing Jessibuca on the window object. ```ts declare global { interface Window { Jessibuca: any; } } ``` -------------------------------- ### Destroy Jessibuca Player Instance Source: https://github.com/gowvp/owl/wiki/GB-T28181-开源日记[6]:React-快速接入-jessibuca.js-播放器 Provides a function to destroy the Jessibuca player instance, releasing resources and preventing memory leaks when the component is unmounted or the player is no longer needed. ```tsx const destroy = () => { console.log("🚀 Jessibuca-player ~ play destroy"); if (p.current) { p.current.destroy(); p.current = null; } }; ``` -------------------------------- ### Disabling AI Detection in config.toml Source: https://github.com/gowvp/owl/blob/main/README.md Set `disabledAI = true` in `configs/config.toml` to disable AI detection, which is enabled by default and runs at 5 frames per second. ```toml disabledAI = true ``` -------------------------------- ### ONVIF Media Service Endpoint Source: https://github.com/gowvp/owl/blob/main/README.md Endpoint for ONVIF media services, typically used for stream retrieval and related media operations. ```APIDOC ## POST /onvif/media_service ### Description Endpoint for ONVIF media services, used for operations related to media streams. ### Method POST ### Endpoint `http://:15123/onvif/media_service` ### Parameters #### Request Body (No specific request body schema provided in the source) ### Request Example (No specific request example provided in the source) ### Response #### Success Response (200) (No specific success response schema provided in the source) #### Response Example (No specific response example provided in the source) ``` -------------------------------- ### React Player Component Structure Source: https://github.com/gowvp/owl/wiki/GB-T28181-开源日记[6]:React-快速接入-jessibuca.js-播放器 Defines the basic structure of a React player component, including props for a ref and the stream link. The component renders a div element that will serve as the player's container. ```tsx interface PlayerProps { ref: React.RefObject; link: string; // 播放的流地址 } export default function Player({ ref,url }: PlayerProps) { const divRef = useRef(null); return
; } ``` -------------------------------- ### Forward Payload Format for Master-Slave Cascading Source: https://github.com/gowvp/owl/blob/main/README.md Defines the JSON payload format for events forwarded from a master GoWVP node to a slave node. Includes event details and an optional base64-encoded image. ```json { "did": "device-id", "cid": "channel-id", "started_at": "2024-01-01T10:00:00Z", "ended_at": "2024-01-01T10:00:01Z", "label": "person", "score": 0.95, "zones": "{\"x_min\":0,\"y_min\":0,\"x_max\":100,\"y_max\":100}", "image_base64": "", "model": "yolov8" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.