Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rtsp-wasm-player

> 编程语言
Open source

RTSP Wasm Player

200 stars0 likes1 views
WebsiteGitHub

About

RTSP Wasm Player

RTSP Wasm Player

Overview

txt
# RTSP WebSocket Proxy
RTSP/Webcam/File > FFmpeg open > Packets > WebSocket

# WS Wasm Player
WebSocket > Packets > Wasm FFmpeg decode to YUV > WebGL display
                                                > Wasm OpenGL display

# WS Local Player
WebSocket > Packets > FFmpeg decode to YUV > OpenGL display

# RTSP Local Player
RTSP/Webcam/File > FFmpeg open and decode to BGR/YUV > OpenCV/OpenGL display

Usage

Prerequisites

  • Ubuntu 18.04

Install develop tools

bash
sudo apt install -y build-essential git wget yasm

# cmake: https://cmake.org/download/
export PATH=./cmake-3.21.1-linux-x86_64/bin:$PATH

Prepare third-party dependencies

  • Boost.Beast: HTTP for stream infos (CORS supported), WebSocket for stream packets.
  • FFmpeg: RTSP/Webcam/File open, decode (h264/hevc/rawvideo), scale and bsf (bitstream filter) for annexb format.
  • glog: logging. It can also enable macro UTIL_LOGGER_ENABLE to use stdout instead.
  • glfw, glew, glm: OpenGL render, yuv420p to rgb888.
  • jbeder/yaml-cpp: read/write config file.
  • nlohmann/json: parse/stringify http json.
…

Rebuild wasm libraries

If wanna rebuild wasm libraries in ws-wasm-player, install Emscripten first:

bash
# Get the emsdk repo
git clone --depth 1 https://github.com/emscripten-core/emsdk.git
# Enter that directory
cd emsdk
# Fetch the latest version of the emsdk (not needed the first time you clone)
git pull
# Download and install the latest SDK tools.
./emsdk install latest
# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh

Then:

…

Build

bash
cd rtsp-wasm-player
# build all projects in rootdir
make
# clean in rootdir
make clean
# clean all, include subdirs
make cleanall

RTSP WebSocket Proxy

txt
RTSP/Webcam/File > FFmpeg open > Packets > WebSocket

Build and run:

bash
cd rtsp-ws-proxy

# build
make
# if wanna build with ssl (COOP need https, otherwise localhost only)
sudo apt install libssl-dev -y
make CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=_install -DUSE_SSL=ON"

# run
./_output/bin/rtsp-ws-proxy ./config.yaml

WS Wasm Player

txt
WebSocket > Packets > Wasm FFmpeg decode to YUV > WebGL display
                                                > Wasm OpenGL display

Run:

bash
cd ws-wasm-player

# Method 1. serve by rtsp-ws-proxy if default config
# open http://127.0.0.1:8080 in browser
#  use https if build with ssl, don't forget to import SSL certificate:
#   1. create: https://stackoverflow.com/a/60516812
#   2. change: rtsp-ws-proxy/config.yaml server.http.ssl_*
#   3. import: chrome://settings/certificates

# Method 2. serve by python http server
python -m http.server 8000
#  if wanna response headers: COOP, COEP
python http_server.py 8000
# open http://127.0.0.1:8000 in browser

WS Local Player

txt
WebSocket > Packets > FFmpeg decode to YUV > OpenGL display

Build and run:

bash
cd ws-local-player

# build
make

# run
./_output/bin/ws-local-player ./config.yaml [stream_id]

RTSP Local Player

txt
RTSP/Webcam/File > FFmpeg open and decode to BGR/YUV > OpenCV/OpenGL display

Build and run:

bash
cd rtsp-local-player

# if wanna enable build with opencv
# export OpenCV_DIR=~/opencv-4/lib/cmake/opencv4

# build
make

# run
./_output/bin/rtsp-local-player_ogl ./cfg_rtsp.yaml
#  or
./_output/bin/rtsp-local-player_ocv ./cfg_webcam.yaml

相关文章

  • FFmpeg 播放 RTSP/Webcam 流
  • RTSP H264/HEVC 流 Wasm 播放

Issues· 1 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言