# nginx-http-flv-module
[![Build Status](https://travis-ci.org/winshining/nginx-http-flv-module.svg?branch=master)](https://travis-ci.org/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>
### Appreciation
* 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 + nginx-http-flv-module-1.2.9
共2000个文件
c:1261个
obj:947个
i:692个
需积分: 11 1 下载量 37 浏览量
2022-07-06
08:46:16
上传
评论
收藏 148.66MB ZIP 举报
温馨提示
nginx + nginx-http-flv-module-1.2.9
资源详情
资源评论
资源推荐
收起资源包目录
nginx + nginx-http-flv-module-1.2.9 (2000个子文件)
ecp_nistz256_table.c 603KB
pcre_compile.c 231KB
pcre_exec.c 183KB
ngx_http_upstream.c 165KB
pcre_ucd.c 154KB
t1_lib.c 147KB
ec_curve.c 140KB
ngx_http_core_module.c 139KB
ngx_http_grpc_module.c 139KB
ngx_http_proxy_module.c 139KB
ngx_http_v2.c 138KB
ngx_event_openssl.c 135KB
s3_clnt.c 126KB
ngx_http_v2_huff_decode.c 126KB
s3_srvr.c 126KB
s_server.c 114KB
ngx_http_mp4_module.c 111KB
ngx_http_fastcgi_module.c 111KB
ssltest.c 110KB
pcre_dfa_exec.c 110KB
s3_lib.c 106KB
ssl_lib.c 104KB
ngx_resolver.c 104KB
ngx_http_request.c 96KB
ca.c 94KB
speed.c 91KB
apps.c 89KB
pcretest.c 86KB
s_client.c 79KB
ngx_http_ssi_filter_module.c 78KB
deflate.c 77KB
x509_vfy.c 77KB
kssl.c 75KB
pcregrep.c 75KB
ngx_http_uwsgi_module.c 74KB
ecp_nistp256.c 74KB
gcm128.c 72KB
e_aes.c 71KB
ecp_nistp521.c 71KB
ngx_rtmp_hls_module.c 70KB
ngx_rtmp_mp4_module.c 69KB
unzip.c 69KB
ngx_http_file_cache.c 69KB
ssl_ciph.c 68KB
ngx_http_flv_live_module.c 67KB
ngx_stream_proxy_module.c 67KB
ngx_event_openssl_stapling.c 66KB
ngx_http_variables.c 66KB
d1_pkt.c 66KB
zip.c 64KB
ecp_nistp224.c 62KB
ectest.c 62KB
bss_dgram.c 62KB
aes_core.c 61KB
ngx_http_scgi_module.c 60KB
s3_pkt.c 59KB
ngx_http_parse.c 59KB
bntest.c 58KB
ngx_http_v2_filter_module.c 57KB
ngx_rtmp_stat_module.c 56KB
e_capi.c 55KB
req.c 55KB
str_lib.c 54KB
inflate.c 54KB
d1_both.c 53KB
ecp_nistz256.c 52KB
ngx_http.c 52KB
ngx_rtmp_relay_module.c 51KB
hw_zencod.c 51KB
s_cb.c 49KB
bn_exp.c 49KB
ngx_http_log_module.c 49KB
ngx_rtmp_notify_module.c 48KB
ngx_mail_auth_http_module.c 47KB
cms.c 47KB
t1_enc.c 47KB
ngx_rtmp_dash_module.c 46KB
ngx_rtmp_live_module.c 46KB
ngx_string.c 45KB
ngx_http_script.c 45KB
ssl_err.c 44KB
ocsp.c 44KB
x509.c 43KB
ec_asn1.c 43KB
ngx_http_geo_module.c 43KB
tunala.c 43KB
trees.c 43KB
e_chil.c 43KB
v3_addr.c 42KB
ssl_sess.c 42KB
t1_trce.c 42KB
ngx_http_image_filter_module.c 42KB
ngx_stream_geo_module.c 42KB
ngx_rtmp_core_module.c 42KB
eng_cryptodev.c 41KB
seed.c 41KB
ngx_connection.c 41KB
ngx_rtmp_exec_module.c 41KB
ngx_stream_log_module.c 41KB
gzlog.c 41KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
inspirely
- 粉丝: 2
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0