# nginx-http-flv-module
[![Build Status](https://app.travis-ci.com/winshining/nginx-http-flv-module.svg?branch=master)](https://app.travis-ci.com/winshining/nginx-http-flv-module)
Media streaming server based on [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module).
[中文说明](https://github.com/winshining/nginx-http-flv-module/blob/master/README.CN.md).
Donate if you like this module. Many thanks to you!
<a href="https://www.buymeacoffee.com/winshining" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
### Credits
* Igor Sysoev, the creator of [NGINX](http://nginx.org).
* Roman Arutyunyan, who created [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module).
* Contributors, refer to [AUTHORS](https://github.com/winshining/nginx-http-flv-module/blob/master/AUTHORS) for details.
## Features
* All features [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module) provides.
* Other features provided by nginx-http-flv-module vs [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module):
| Features | nginx-http-flv-module | nginx-rtmp-module | Remarks |
| :---------------------: | :-------------------: | :---------------: | :---------------------------------------------: |
| HTTP-FLV (for play) | √ | x | HTTPS-FLV and chunked response supported |
| GOP cache | √ | x | |
| VHOST | √ | x | |
| Omit `listen` directive | √ | See remarks | There MUST be at least one `listen` directive |
| Audio-only support | √ | See remarks | Won't work if `wait_video` or `wait_key` is on |
| `reuseport` support | √ | x | |
| Timer for access log | √ | x | |
| JSON style stat | √ | x | |
| Stat for recordings | √ | x | |
## Compatibility
The [NGINX](http://nginx.org) version **SHOULD** be equal to or greater than 1.2.6, the compatibility with other versions is unknown.
## Systems supported
* Linux (recommended) / FreeBSD / MacOS / Windows (limited).
## Players supported
* [VLC](http://www.videolan.org) (RTMP & HTTP-FLV) / [OBS](https://obsproject.com) (RTMP & HTTP-FLV) / [JW Player](https://www.jwplayer.com) (RTMP) / [flv.js](https://github.com/Bilibili/flv.js) (HTTP-FLV).
### Note
* [Flash player](https://www.adobe.com/products/flashplayer.html) will be no longer supported officially by Adobe after December 31, 2020, refer to [Adobe Flash Player EOL General Information Page](https://www.adobe.com/products/flashplayer/end-of-life.html) for details. Plugins that use flash player won't work after the major browsers subsequently remove flash player.
* [flv.js](https://github.com/Bilibili/flv.js) can only run with browsers that support [Media Source Extensions](https://www.w3.org/TR/media-source).
## Prerequisites
* GNU make for activating compiler on Unix-like systems to compile software.
* GCC for compilation on Unix-like systems or MSVC for compilation on Windows.
* GDB for debug on Unix-like systems.
* [FFmpeg](http://ffmpeg.org) or [OBS](https://obsproject.com) for publishing media streams.
* [VLC](http://www.videolan.org) (recommended) or [flv.js](https://github.com/Bilibili/flv.js) (recommended) for playing media streams.
* [PCRE](http://www.pcre.org) for NGINX if regular expressions needed.
* [OpenSSL](https://www.openssl.org) for NGINX if encrypted access needed.
* [zlib](http://www.zlib.net) for NGINX if compression needed.
## Build
### Note
nginx-http-flv-module has all features that [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module) provides, so **DON'T** compile nginx-http-flv-module along with [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module).
### On Windows
For details about build steps, please refer to [Building nginx on the Win32 platform with Visual C](http://nginx.org/en/docs/howto_build_on_win32.html), and don't forget to add `--add-module=/path/to/nginx-http-flv-module` in `Run configure script` step.
#### Note
If some compilers which do not support x64 perfectly, VS2010 for example, are used to compile the module, please make sure that the default settings are used (target machine type x86).
### On Unix-like systems
Download [NGINX](http://nginx.org) and nginx-http-flv-module.
Uncompress them.
cd to NGINX source directory & run this:
#### Compile the module into [NGINX](http://nginx.org)
./configure --add-module=/path/to/nginx-http-flv-module
make
make install
or
#### Compile the module as a dynamic module
./configure --add-dynamic-module=/path/to/nginx-http-flv-module
make
make install
#### Note
If the module is compiled as a dynamic module, the [NGINX](http://nginx.org) version **MUST** be equal to or greater than 1.9.11.
## Usage
For details of usages of [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module), please refer to [README.md](https://github.com/arut/nginx-rtmp-module/blob/master/README.md).
### Publish
For simplicity, transcoding is not used (so **-c copy** is used):
ffmpeg -re -i MEDIA_FILE_NAME -c copy -f flv rtmp://example.com[:port]/appname/streamname
#### Note
Some legacy versions of [FFmpeg](http://ffmpeg.org) don't support the option `-c copy`, the options `-vcodec copy -acodec copy` can be used instead.
The `appname` is used to match an application block in rtmp block (see below for details).
The `streamname` can be specified at will but can **NOT** be omitted.
The **default port for RTMP** is **1935**, if some other ports were used, `:port` must be specified.
### Play
#### via HTTP-FLV
http://example.com[:port]/dir?[port=xxx&]app=appname&stream=streamname
#### Note
* If [ffplay](http://www.ffmpeg.org/ffplay.html) is used in command line to play the stream, the url above **MUST** be enclosed by quotation marks, or arguments in url will be discarded (some shells not so smart will interpret "&" as "run in background").
* If [flv.js](https://github.com/Bilibili/flv.js) is used to play the stream, make sure that the published stream is encoded properly, for [flv.js](https://github.com/Bilibili/flv.js) supports **ONLY H.264 encoded video and AAC/MP3 encoded audio**.
The `dir` is used to match location blocks in http block (see below for details).
The **default port for HTTP** is **80**, if some other ports were used, `:port` must be specified.
The **default port for RTMP** is **1935**, if some other ports were used, `port=xxx` must be specified.
The value of `app` (appname) is used to match an application block, but if the requested `app` appears in several server blocks and those blocks have the same address and port configuration, host name matches `server_name` directive will be additionally used to identify the requested application block, otherwise the first one is matched.
The value of `stream` (streamname) is used to match the name of published stream.
#### Example
Assume that `listen` directive specified in `http` block is:
http {
...
server {
listen 8080; #not default port 80
...
location /live {
flv_live on;
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
nginx-http-flv-module-master.zip (96个子文件)
nginx-http-flv-module-master
.travis.yml 358B
ngx_http_flv_live_module.c 68KB
ngx_rtmp_bandwidth.h 584B
ngx_rtmp_live_module.h 3KB
ngx_rtmp_eval.h 843B
config 7KB
ngx_rtmp_handler.c 25KB
hls
ngx_rtmp_hls_module.h 256B
ngx_rtmp_mpegts.c 10KB
ngx_rtmp_mpegts.h 1020B
ngx_rtmp_hls_module.c 70KB
ngx_rtmp_core_module.c 42KB
ngx_rtmp_bitop.c 1KB
ngx_rtmp_record_module.h 3KB
ngx_rtmp_handshake.c 17KB
ngx_rtmp_streams.h 378B
ngx_rtmp_record_module.c 36KB
ngx_rtmp_amf.c 16KB
ngx_rtmp_variables.c 32KB
ngx_rtmp_control_module.c 18KB
ngx_rtmp_relay_module.h 3KB
ngx_rtmp_netcall_module.c 19KB
.github
FUNDING.yml 44B
ISSUE_TEMPLATE.md 463B
CONTRIBUTING.md 2KB
CODE_OF_CONDUCT.md 3KB
test
nginx.conf 1KB
rtmp-publisher
RtmpPlayer.mxml 2KB
publisher.html 505B
RtmpPublisher.swf 46KB
RtmpPlayer.swf 46KB
swfobject.js 10KB
RtmpPublisher.mxml 3KB
RtmpPlayerLight.mxml 3KB
RtmpPlayerLight.swf 46KB
README.md 314B
player.html 614B
www
index.html 505B
jwplayer
jwplayer.flash.swf 135KB
jwplayer.js 36KB
record.html 1KB
bg.jpg 15KB
jwplayer_old
swfobject.js 10KB
player.swf 49KB
dump.sh 49B
ffstream.sh 84B
README.md 499B
play.sh 59B
ngx_rtmp_play_module.h 2KB
ngx_rtmp_notify_module.c 48KB
ngx_rtmp_flv_live_index_module.c 1KB
ngx_rtmp_init.c 10KB
ngx_rtmp_relay_module.c 51KB
ngx_rtmp_codec_module.c 27KB
ngx_rtmp_exec_module.c 41KB
ngx_rtmp_cmd_module.c 25KB
LICENSE 1KB
ngx_rtmp_send.c 19KB
ngx_rtmp_proxy_protocol.c 4KB
ngx_rtmp.c 36KB
ngx_rtmp_proxy_protocol.h 311B
ngx_rtmp_log_module.c 30KB
ngx_rtmp_cmd_module.h 5KB
ngx_rtmp_mp4_module.c 69KB
ngx_rtmp_variables.h 3KB
ngx_rtmp_receive.c 11KB
ngx_rtmp_limit_module.c 5KB
samples
flv.js.png 1.28MB
jwplayer_vlc.png 1.09MB
ngx_rtmp_amf.h 2KB
dash
ngx_rtmp_dash_module.c 46KB
ngx_rtmp_mp4.h 1KB
ngx_rtmp_mp4.c 23KB
ngx_rtmp_play_module.c 32KB
ngx_rtmp_auto_push_module.c 20KB
ngx_rtmp_access_module.c 11KB
AUTHORS 775B
doc
README.md 80B
ngx_rtmp_stat_module.c 56KB
ngx_rtmp_live_module.c 46KB
ngx_rtmp_shared.c 3KB
stat.xsl 18KB
ngx_rtmp_bandwidth.c 589B
ngx_http_flv_live_module.h 2KB
ngx_rtmp_gop_cache_module.c 27KB
README.md 15KB
ngx_rtmp_version.h 268B
ngx_rtmp_gop_cache_module.h 2KB
ngx_rtmp_bitop.h 1KB
ngx_rtmp_parse.c 19KB
ngx_rtmp_netcall_module.h 2KB
ngx_rtmp_flv_module.c 19KB
ngx_rtmp_eval.c 6KB
ngx_rtmp.h 26KB
README.CN.md 15KB
ngx_rtmp_codec_module.h 3KB
共 96 条
- 1
小昊爱金玉
- 粉丝: 4
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- oracle 触发器语法及 for each row 详细说明
- 微信小程序-豆瓣图书源码
- Fragment - Unknow animation name objectAnimator 问题解决及源码分析
- 词向量-中文文本相似度计算-采用text2vec词向量工具进行计算对比.zip
- 521293804316625base(1).apk
- ARP IP地址分类及特殊IP
- 【MySQL补丁】vcredist-x64xz MySQL必备插件
- 基于SG3525芯片PWM控制推挽隔离DCDC电源模块AD09设计硬件(原理图+PCB)工程文件.zip
- Word_20240428_092324.docx
- cloudcc_v1.1.10-release_sign.apk
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0