Documentation
¶
Overview ¶
hls demo:用 pkg/hls 起一个直播 origin,挂在 webserver 上,后台每 2s 喂一个 合成分片(内容是占位字节,非真实 TS——本示例只演示 origin 的播放列表/分片分发, 不涉及编解码)。
运行:
go run ./examples/hls # 另开一个终端: curl -s localhost:8090/live/index.m3u8 # 看滚动播放列表 curl -s localhost:8090/live/seg0.ts # 拉某个分片(占位数据)
真实场景里,分片由 ffmpeg 或 pkg/media/rtmp 采集后的 remux 产出,再 Append 进来。
Click to show internal directories.
Click to hide internal directories.