天天看點

RTSP H264 流 MSE 播放

elsampsa/websocket-mse-demo 項目介紹:

It this demo we're streaming live video from an RTSP camera to your HTML5 browser. Video is streamed as H264 encapsulated in MP4. No transcoding takes place in the stream-to-browser pipeline. No browser-side flash or pure-javascript decoders required. Video is decoded and presented in the browser using the W3 Media Source Extensions that is well supported by all major browsers by > now. Only H264 is supported - browser MSE's do not support H246 yet (and neither does libValkka).

實作了浏覽器 MSE (Media Source Extensions) 播放相機 RTSP (Real Time Streaming Protocol) 流。動手體驗一下咯~

發送 RTSP 流:

啟動程式:

RTSP H264 流 MSE 播放

打開浏覽器:

RTSP H264 流 MSE 播放

技術:

WebSocket

MediaSource: 建構媒體流,供 video/audio 元素播放

WebRTC: 可直接捕獲用戶端視訊流,并點對點傳輸、不依賴伺服器中轉

WebCodecs: 編解碼音視訊

WebAssembly: C/C++/Rust 等編譯進前端使用

ffmpegwasm/ffmpeg.wasm

GoogleChromeLabs/webm-wasm

項目:

MSE: 需建構流,通常容器格式是 ISO BMFF (Fragmented MP4) = fMP4

elsampsa/websocket-mse-demo: RTSP > fMP4

ChihChengYang/wfs.js: H.264 NAL > fMP4

bilibili/flv.js: FLV > fMP4

Garefield/RTSP-WS-Proxy: RTSP > fMP4

Streamedian/html5_rtsp_player: RTSP > fMP4, Proxy 收費

JS 解碼

phoboslab/jsmpeg: MPEG1 Video & MP2 Audio Decoder

kyriesent/node-rtsp-stream

wanghaoxi3000/gin-rtsp

YE-Fan/JAVA-RTSP-JSMpeg

Aleckgt/rtsp-ws-proxy

k-yle/rtsp-relay

mbebenita/Broadway: H.264 decoder

131/h264-live-player

Wasm 解碼

sonysuqin/WasmVideoPlayer: H265 > YUV, WebGL

wupeng-engineer/decoder_wasm: H264,H265 > YUV, WebGL

gliese1337/h264decoder: H264 > YUV

mattdesl/mp4-h264: H264 > YUV/RGB

mattdesl/mp4-wasm: H264

其他

HTML5 RTSP player: 收費

GoCoding 個人實踐的經驗分享,可關注公衆号!

繼續閱讀