GB T28181 开源日记[7]:实现 RTMP 鉴权与播放
ixugo. edited this page 2025-02-10 10:06:40 +08:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

实现 RTMP 鉴权与播放

image-20250125192930060

大概流程如上图所示。

第一步由具有 rtmp 推流功能的 IPC/OBS 或相应设备,向流媒体服务 zlmediakit 发起推流。

zlm 会触发 on_publish webhook 回调到 gowvpgowvp 检查推流通道是否存在,然后鉴权,应答允许推流,流数据进入 zlmzlm 触发 on-stream-changed webhook 通知。

客户端调用 gowvp 的播放接口,获取多种协议(webrtc/flv/hls/rtmp/rtsp)的播放地址,流连接塞入播放器开始播放。

zlm 触发 on_play webhook 回调到 gowvp 播放鉴权,gowvp 识别到正确的通道和鉴权信息,回应鉴权通过后,zlm 正式响应客户端,回复客户端所请求的流数据。

整个流程简单通俗易懂,我都没有办法多水一点文字。

服务端的开发是不是很简单呢?