RTSP WASM 播放器
# 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 displaysudo apt install -y build-essential git wget yasm
# cmake: https://cmake.org/download/
export PATH=./cmake-3.21.1-linux-x86_64/bin:$PATHUTIL_LOGGER_ENABLE to use stdout instead.…wasm librariesIf wanna rebuild wasm libraries in ws-wasm-player, install Emscripten first:
# 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.shThen:
…cd rtsp-wasm-player
# build all projects in rootdir
make
# clean in rootdir
make clean
# clean all, include subdirs
make cleanallRTSP/Webcam/File > FFmpeg open > Packets > WebSocketBuild and run:
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.yamlWebSocket > Packets > Wasm FFmpeg decode to YUV > WebGL display
> Wasm OpenGL displayRun:
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 browserWebSocket > Packets > FFmpeg decode to YUV > OpenGL displayBuild and run:
cd ws-local-player
# build
make
# run
./_output/bin/ws-local-player ./config.yaml [stream_id]RTSP/Webcam/File > FFmpeg open and decode to BGR/YUV > OpenCV/OpenGL displayBuild and run:
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暂无开放 Issues,或尚未同步最近议题。