illuspas/nginx-live-win32
关于
nginx-live-module 的 Windows 构建版本。
设计与媒体可以做什么
- RTMP publishing/playback (compatible with OBS, FFmpeg, etc.)
- Enhanced RTMP v1: native HEVC (H.265), AV1, VP9 and Opus support, forwarded without transcoding
- Enhanced RTMP v2 multi-track audio (Multitrack): several audio tracks forwarded in parallel within one stream, each with its own cached sequence header replayed to joining players; the encapsulation is passed through as-is (no muxing, no transcoding)
- HTTP-FLV publishing (POST) / playback (GET) with HTTP/1.1 chunked transfer
实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- -1
- 1个月
- 0
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README_CN.md
原文nginx-live-win32
简体中文 | English
简介
nginx-live-win32 是 nginx + nginx-live-module 的 Windows 绿色包(解压即用,免安装), 实现高性能、低延迟的开源直播流媒体服务器,支持 RTMP / Enhanced RTMP / HTTP-FLV 推流与播放。
包内另附 nginx_service.exe:把 nginx 注册为 Windows 服务,并提供系统托盘管理界面。
版本号、编译参数、exe 大小与 SHA256 由构建脚本自动生成在 BUILD-INFO.txt, 请以该文件为准(不要手工编辑、也不要在这里手写版本)。
特性
- RTMP 推流/播放(兼容 OBS、FFmpeg 等)
- Enhanced RTMP v1:原生支持 HEVC (H.265)、AV1、VP9、Opus,无需转码直接转发
- Enhanced RTMP v2 多音轨音频(Multitrack):同一路流内多条音频轨并行转发,每轨独立缓存序列头、新连接按轨补齐,封装原样透传(不混流、不转码)
- HTTP-FLV 推流(POST)/ 播放(GET),HTTP/1.1 chunked
- WS/WSS-flv 推流 / 播放
- GOP 缓存,播放端从最近关键帧秒开(≤ 1 个 GOP)
- 访问控制:
allow/deny publish|play(支持 CIDR,RTMP 与 HTTP-FLV 共用) - JSON 状态接口
/stat:流列表、编码格式、码量、客户端数等实时统计 - 慢消费者保护:待发队列超限丢帧重同步,持续停滞断开单个订阅者,不影响他人
- 静态文件服务(nginx 原生能力,
html/目录) - Windows 服务 + 托盘管理(安装、启动、停止、卸载)
下载
- 推荐:到 Releases 页下载
nginx-live-<版本>-win32.zip(绿色包,解压即用), 同页附SHA256SUMS.txt校验和;每个版本的构建来源与组件版本见 Release 说明。 - 也可以直接 clone 本仓库:仓库内提交的就是同一份可运行包。
使用方法
快速开始
- 直接运行:双击
nginx.exe - 作为服务/托盘管理:运行
nginx_service.exe(安装、启动、停止、卸载、打开配置/页面) - 命令行停止:
nginx.exe -s stop - 重新加载配置:
nginx.exe -s reload
默认端口(见 conf/nginx.conf):
| 端口 | 协议 | 用途 |
|---|---|---|
| 1935 | RTMP | 推流 / 拉流,application live |
| 8080 | HTTP | HTTP-FLV 拉流 / 推流、状态页 |
推流
OBS:设置 → 推流 → 自定义服务器,填 rtmp://<服务器IP>:1935/live,串流密钥任意(即流名)。
FFmpeg:
# H.264 + AAC
ffmpeg -re -i input.mp4 -c copy -f flv rtmp://127.0.0.1:1935/live/mystream
# HEVC/AV1/VP9/Opus 源直接 copy(Enhanced RTMP 封装,无需转码)
ffmpeg -re -i input_265.mp4 -c copy -f flv rtmp://127.0.0.1:1935/live/hevc
也支持 HTTP-FLV 推流(POST):
ffmpeg -re -i input.mp4 -c copy -f flv http://127.0.0.1:8080/live/mystream
播放
# RTMP
ffplay rtmp://127.0.0.1:1935/live/mystream
# HTTP-FLV
ffplay http://127.0.0.1:8080/live/mystream.flv
浏览器播放可配合支持 HTTP-FLV 的播放器,如 NodePlayer.js(原生支持 Enhanced-FLV H.265)。
状态查看
curl -s http://127.0.0.1:8080/stat
返回 JSON:应用与流列表、是否在推、客户端数、音视频编码、收发字节数、运行时长等。
多音轨流的 audio_codec 取第一条音轨,其余音轨编码不在此字段体现。
配置说明
conf/nginx.conf 为配置文件实例:
rtmp {
server {
listen 1935; # RTMP 监听
gop_cache on; # GOP 缓存(秒开)
chunk_size 65535;
application live {
live on; # 推拉开关
# allow publish 127.0.0.1; # 可选:访问控制
# deny publish all;
}
}
}
http {
server {
listen 8080;
location ~ ^/[a-z0-9_]+/.+(\.flv)?$ {
live_flv on; # HTTP-FLV 推/拉流端点 /<app>/<stream>[.flv]
}
location = /stat {
live_stat on; # JSON 状态接口
}
}
}
常用指令(完整说明见模块文档 docs/usage.md):
| 指令 | 默认 | 说明 |
|---|---|---|
listen <addr:port> |
— | RTMP 监听地址,可多条 |
live on|off |
off |
关闭时发布/播放返回 503 |
gop_cache on|off |
on |
GOP 缓存,秒开 |
chunk_size <n> |
65535 |
RTMP 出站 chunk size |
timeout <t> |
60s |
握手/发送停滞/发布空闲超时 |
allow/deny [publish|play] <addr>|all |
放行 | 按书写顺序匹配,支持 CIDR |
live_flv on|off |
off |
HTTP 端启用 HTTP-FLV 推/拉 |
live_stat on|off |
off |
HTTP 端启用 /stat |
注意:流表为 per-worker,生产环境建议保持 worker_processes 1。
支持的编码
| 类型 | legacy FLV | Enhanced RTMP v1(FourCC) |
|---|---|---|
| 视频 | H.264 | HEVC hvc1、AV1 av01、VP9 vp09 |
| 音频 | AAC、MP3 等 | Opus、ac-3、ec-3、.mp3、fLaC |
音频轨支持 Enhanced RTMP v2 Multitrack 的三种模式:单轨(OneTrack)、
多轨各自成 tag(ManyTracks-ManyTracks)、一份音频数据多轨共用(ManyTracks-OneTrack)。
服务端按 trackIndex 为每条音频轨缓存序列头(最多 16 条),新播放端接入时逐轨下发,
音轨选择由播放端完成;RTMP 与 HTTP-FLV/WS-FLV 输出均为原始 tag 透传。
已知限制
- 不支持 Flash 时代的旧式 RTMP 扩展 H.265(如
cdn_cnflv_265 标准) - AMF3 命令(objectEncoding=3)不支持
- 多音轨的序列头缓存上限为 16 条:
trackIndex ≥ 16的数据仍照常转发,但其序列头不缓存, 后加入的播放端拿不到该轨的解码配置 /stat的audio_codec只显示第一条(索引最小的)音轨的编码- reload 后新 worker 流表为空,已有流对新连接不可见(长连接场景可配置
worker_shutdown_timeout)
支持的客户端
| Client | H.264 | HEVC | VP9 | AV1 |
|---|---|---|---|---|
| OBS_29.1+ | ✅ | ✅ | ❌ | ✅ |
| FFmpeg/FFplay_6.1+ | ✅ | ✅ | ✅ | ✅ |
| NodePlayer.js_1.0+ | ✅ | ✅ | ❌ | ❌ |
| NodeMediaClient_3.0+ | ✅ | ✅ | ❌ | ❌ |
QLive
Free Android Live Streaming App
NodePlayer.js pure javascript implementation live streaming player
- ASM.js, WASM, SIMD, WebWorker, WebCodecs, MediaSource multiple technical implementations
- H.264/H.265+AAC/G711 software and hardware decoder
- Ultra-low latency, Under extreme conditions less than 100 milliseconds
- Enhanced HTTP/WS-FLV Protocol, Natively support h.265
- Android/iOS/HarmonyOS/Chrome/Edge/Firefox/Safari, All modern browsers or platforms
NodePublisher.js pure javascript implementation live streaming publisher
- WebSocket-FLV Protocol
- H.264+AAC hardware encoder
- Only chrome or chromium based browsers are supported at the moment
- wss is required
NodeMediaClient-iOS iOS live streaming player and publisher SDK
- Objective-C/Swift
- RTMP/HTTP-FLV/RTSP
- H.264/H.265+AAC/OPUS/G711
- Ultra-low latency, Under extreme conditions less than 100 milliseconds
- Enhanced RTMP/FLV Protocol, Natively support H.265/OPUS
- Built-in beauty filter
NodeMediaClient-Android Android live streaming player and publisher SDK
- JAVA/Kotlin
- armv7/arm64/x86/x86_64
- RTMP/HTTP-FLV/RTSP
- H.264/H.265+AAC/OPUS/G711
- Ultra-low latency, Under extreme conditions less than 100 milliseconds
- Enhanced RTMP/FLV Protocol, Natively support H.265/OPUS
- Built-in beauty filter
expo-nodemediaclient Expo module for NodeMediaClient
- iOS and Android
- player and publisher
许可与来源
本包是 nginx + nginx-live-module + 服务管理器的组合二进制,各组件的许可证全文随包
附在 LICENSES/ 目录,完整清单与版权声明见 THIRD-PARTY-NOTICES.md:
| 组件 | 许可证 |
|---|---|
| nginx | BSD 2-Clause |
| nginx-live-module、服务管理器 | Apache License 2.0 |
| OpenSSL | Apache License 2.0 |
| PCRE2 | BSD 3-Clause(含 PCRE2 例外条款) |
| zlib | zlib License |
nginx 是 Nginx, Inc. 的注册商标;本包是独立第三方构建,与 Nginx, Inc. 无隶属关系。
探索相关项目
加载中…