前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >使用nginx搭建简单的流媒体服务器(rtmp)

使用nginx搭建简单的流媒体服务器(rtmp)

作者头像
liuzhen007
发布于 2021-06-29 07:54:04
发布于 2021-06-29 07:54:04
1.5K00
代码可运行
举报
文章被收录于专栏:流媒体音视频流媒体音视频
运行总次数:0
代码可运行
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
==> Installing nginx-full from denji/nginx
==> Installing dependencies for denji/nginx/nginx-full: pcre, openssl and rtmp-nginx-module
==> Installing denji/nginx/nginx-full dependency: pcre
==> Downloading homebrew.bintray.com/bottles/pcr…
######################################################################## 100.0%
==> Pouring pcre-8.42.high_sierra.bottle.tar.gz
?  /usr/local/Cellar/pcre/8.42: 204 files, 5.3MB
==> Installing denji/nginx/nginx-full dependency: openssl
==> Downloading homebrew.bintray.com/bottles/ope….
######################################################################## 100.0%
==> Pouring openssl-1.0.2p.high_sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
==> Summary
?  /usr/local/Cellar/openssl/1.0.2p: 1,793 files, 12.3MB
==> Installing denji/nginx/nginx-full dependency: rtmp-nginx-module
==> Downloading github.com/sergey-drya…
==> Downloading from codeload.github.com/sergey-drya…
######################################################################## 100.0%
==> Downloading github.com/sergey-drya…
######################################################################## 100.0%
==> Patching
==> Applying v1.1.7.10...504b9ee.diff
patching file .gitignore
patching file README.md
patching file config
patching file dash/ngx_rtmp_dash_module.c
patching file doc/README.md
patching file doc/directives.md
patching file hls/ngx_rtmp_hls_module.c
patching file hls/ngx_rtmp_mpegts.c
patching file hls/ngx_rtmp_mpegts.h
patching file hls/ngx_rtmp_mpegts_crc.c
patching file hls/ngx_rtmp_mpegts_crc.h
patching file ngx_rtmp.c
patching file ngx_rtmp_access_module.c
patching file ngx_rtmp_amf.c
patching file ngx_rtmp_auto_push_module.c
patching file ngx_rtmp_cmd_module.h
patching file ngx_rtmp_codec_module.c
patching file ngx_rtmp_core_module.c
patching file ngx_rtmp_eval.c
patching file ngx_rtmp_exec_module.c
patching file ngx_rtmp_handshake.c
patching file ngx_rtmp_init.c
patching file ngx_rtmp_live_module.c
patching file ngx_rtmp_live_module.h
patching file ngx_rtmp_netcall_module.c
patching file ngx_rtmp_notify_module.c
patching file ngx_rtmp_record_module.c
patching file ngx_rtmp_record_module.h
patching file ngx_rtmp_shared.c
patching file ngx_rtmp_version.h
?  /usr/local/Cellar/rtmp-nginx-module/1.1.7.11-dev_3: 94 files, 1.4MB, built in 21 seconds
==> Installing denji/nginx/nginx-full --with-rtmp-module
==> Downloading nginx.org/download/ng…
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/nginx-full/1.15.6 --with-http_ssl_mod
==> make install
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
Tips
Run port 80:
sudochownroot:wheel/usr/local/opt/nginx−full/bin/nginxsudo chown root:wheel /usr/local/opt/nginx-full/bin/nginxsudochownroot:wheel/usr/local/opt/nginx−full/bin/nginx sudo chmod u+s /usr/local/opt/nginx-full/bin/nginx
Reload config:
nginx−sreloadReopenLogfile:nginx -s reload Reopen Logfile:nginx−sreloadReopenLogfile: nginx -s reopen
Stop process:
nginx−sstopWaitingonexitprocessnginx -s stop Waiting on exit processnginx−sstopWaitingonexitprocess nginx -s quit
To have launchd start denji/nginx/nginx-full now and restart at login:
brew services start denji/nginx/nginx-full
Or, if you don't want/need a background service you can just run:
nginx
==> Summary
?  /usr/local/Cellar/nginx-full/1.15.6: 8 files, 1.2MB, built in 1 minute
==> Caveats
==> openssl
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:PATH"′>> /.bashprofileForcompilerstofindopensslyoumayneedtoset:exportLDFLAGS="−L/usr/local/opt/openssl/lib"exportCPPFLAGS="−I/usr/local/opt/openssl/include"Forpkg−configtofindopensslyoumayneedtoset:exportPKGCONFIGPATH="/usr/local/opt/openssl/lib/pkgconfig"==>nginx−fullDocrootis:/usr/local/var/wwwThedefaultporthasbeensetin/usr/local/etc/nginx/nginx.confto8080sothatnginxcanrunwithoutsudo.nginxwillloadallfilesin/usr/local/etc/nginx/servers/.TipsRunport80:PATH"' >> ~/.bash_profile For compilers to find openssl you may need to set:  export LDFLAGS="-L/usr/local/opt/openssl/lib"  export CPPFLAGS="-I/usr/local/opt/openssl/include" For pkg-config to find openssl you may need to set:  export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" ==> nginx-full Docroot is: /usr/local/var/www The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that nginx can run without sudo. nginx will load all files in /usr/local/etc/nginx/servers/. Tips Run port 80:  PATH"′>> /.bashprofileForcompilerstofindopensslyoumayneedtoset:exportLDFLAGS="L/usr/local/opt/openssl/lib"exportCPPFLAGS="I/usr/local/opt/openssl/include"Forpkg−configtofindopensslyoumayneedtoset:exportPKGCONFIGPATH="/usr/local/opt/openssl/lib/pkgconfig"==>nginx−fullDocrootis:/usr/local/var/wwwThedefaultporthasbeensetin/usr/local/etc/nginx/nginx.confto8080sothatnginxcanrunwithoutsudo.nginxwillloadallfilesin/usr/local/etc/nginx/servers/.TipsRunport80: sudo chown root:wheel /usr/local/opt/nginx-full/bin/nginx
sudochmodu+s/usr/local/opt/nginx−full/bin/nginxReloadconfig:sudo chmod u+s /usr/local/opt/nginx-full/bin/nginx Reload config:sudochmodu+s/usr/local/opt/nginx−full/bin/nginxReloadconfig: nginx -s reload
Reopen Logfile:
nginx−sreopenStopprocess:nginx -s reopen Stop process:nginx−sreopenStopprocess: nginx -s stop
Waiting on exit process
$ nginx -s quit
To have launchd start denji/nginx/nginx-full now and restart at login:
brew services start denji/nginx/nginx-full
Or, if you don't want/need a background service you can just run:
nginx
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-05-12,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 玩转音视频 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
2019-03-28 mac 用brew安装nginx
mac 用brew安装nginx 其实我主要是记录默认的几个目录的 brew install nginx Updating Homebrew... ==> Auto-updated Homebrew! Updated 3 taps (homebrew/core, homebrew/cask and caskroom/cask). ==> New Formulae buildkit gitleaks llvm@7
Albert陈凯
2019/04/01
1.5K0
iOS直播app之Mac搭建nginx+rtmp服务器
前言 今年移动直播行业的兴起,很多公司都在做直播,转眼间过了大半年了,直播的各种技术相对成熟了起来。今天我们公司也追赶潮流,索性我也转战直播,下面从第一步开始,Mac环境下如何搭建nginx+rtmp服务器。 nginx是非常优秀的开源服务器,用它来做hls或者rtmp流媒体服务器是非常不错的选择。
s_在路上
2018/09/11
4.1K1
iOS直播app之Mac搭建nginx+rtmp服务器
Homebrew简介与安装
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书
Tyan
2022/05/09
7900
Nginx流媒体服务器搭建
下载地址:http://nginx.org/download/nginx-1.12.1.tar.gz
aruba
2020/12/21
7.4K0
Nginx流媒体服务器搭建
pipx在隔离环境中运行python应用
阿超
2024/09/27
2660
Mac安装brew,安装wget「建议收藏」
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/137707.html原文链接:https://javaforall.cn
全栈程序员站长
2022/09/05
9420
Mac升级Mysql
brew upgrade mysql ==> Upgrading 1 outdated package: mysql 5.7.19 -> 8.0.12 ==> Upgrading mysql ==> Installing dependencies for mysql: openssl ==> Installing mysql dependency: openssl ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2p.hig
青山师
2023/05/05
9260
Mac OS X 安装 Nginx
nginx -V 查看版本,以及配置文件地址 nginx -v 查看版本 nginx -c filename 指定配置文件 nginx -h 帮助
阳光岛主
2019/02/18
2K0
Mac OS X 安装 Nginx
Linux下视频流媒体服务器搭建详解「建议收藏」
用于支持培训网站中视频点拨功能,在培训网站总体方案中需要加入流媒体服务器,用于存储和传输视频资源。
全栈程序员站长
2022/11/01
7.9K0
Linux下视频流媒体服务器搭建详解「建议收藏」
Nginx 动态编译加载第三方流媒体服务模块:Nginx-RTMP-Module
Nginx 1.9.11开始增加加载动态模块支持,可以在不停机的情况下加载和卸载模块。从此不再需要替换nginx文件即可增加第三方扩展。目前官方只有几个模块支持动态加载,第三方模块需要升级支持才可编译成模块。
Tinywan
2024/03/02
5080
Nginx 动态编译加载第三方流媒体服务模块:Nginx-RTMP-Module
搭建nginx rtmp流媒体服务器(超详细)_nginx rtmp 集群
本微博在借鉴其他大牛之后,觉得应该写一个直播的完整流程,虽然简单,但是会有一个宏观感受:
全栈程序员站长
2022/09/27
5.5K0
搭建nginx rtmp流媒体服务器(超详细)_nginx rtmp 集群
openresy+nginx-rtmp-module搭建点播直播服务器
一般点播或者直播服务器都是使用nginx-rtmp-module作为服务器,然后使用ffmpeg或者obs来进行推流,客户端使用rtmp、http-flv、hls或者dash协议拉取转码后的数据,进行播放。
golangLeetcode
2024/04/10
5840
openresy+nginx-rtmp-module搭建点播直播服务器
mark-text开发环境搭建启动
https://github.com/VampireAchao/marktext.git
阿超
2023/07/08
2800
mark-text开发环境搭建启动
Nginx添加rtmp模块搭建rtmp推流服务器
前言 搭建基于rtmp协议的推流服务器。 环境Centos 7 + Nginx 我这里默认nginx是用yum安装的 所以这篇文章最大可能和yum安装的nginx保持相同的配置 yum安装目录介绍 /usr/sbin/nginx 执行文件 /usr/lib64/nginx/modules/ 依赖模块目录 /etc/nginx 配置文件路径 /usr/share/nginx 默认的站点目录 安装Nginx和相关依赖 0、查看Nginx的版本和依赖 nginx -V 1、安装Nginx及其依赖库: #
码客说
2019/10/22
8.1K1
【Nginx】如何使用Nginx搭建流媒体服务器实现直播?看完这篇我会了!!(文末有福利)
作者个人研发的在高并发场景下,提供的简单、稳定、可扩展的延迟消息队列框架,具有精准的定时任务和延迟队列处理功能。自开源半年多以来,已成功为十几家中小型企业提供了精准定时调度方案,经受住了生产环境的考验。为使更多童鞋受益,现给出开源框架地址:
冰河
2020/10/29
2K0
【Nginx】如何使用Nginx搭建流媒体服务器实现直播?看完这篇我会了!!(文末有福利)
【Android RTMP】RTMP 直播推流服务器搭建 ( Ubuntu 18.04.4 虚拟机 )
① 数据采集 : 使用 Camera 相机采集图像数据 , 使用 AudioRecord 采集声音 ;
韩曙亮
2023/03/27
9.7K0
【Android RTMP】RTMP 直播推流服务器搭建 ( Ubuntu 18.04.4 虚拟机 )
☀️全网唯一万字长文讲解Nginx安装运营维护☀️《❤️记得收藏❤️》
Nginx 是一款面向性能设计的 HTTP 服务器,能反向代理 HTTP,HTTPS 和邮件相关(SMTP,POP3,IMAP)的协议链接。并且提供了负载均衡以及 HTTP 缓存。它的设计充分使用异步事件模型,削减上下文调度的开销,提高服务器并发能力。采用了模块化设计,提供了丰富模块的第三方模块。
苏州程序大白
2021/08/23
1.9K0
☀️全网唯一万字长文讲解Nginx安装运营维护☀️《❤️记得收藏❤️》
视频直播| 搭建一个本地nginx服务器以及实现推流和拉流
原想用mac中自带的Apache搭建,但是naginx是轻量级的,同样起web 服务,也比apache 占用更少的内存及资源,nginx 处理请求是异步非阻塞的,而apache 则是阻塞型的,在高并发下nginx 能保持低资源低消耗高性能,用它来做hls或者rtmp流媒体服务器是非常不错的选择.
進无尽
2018/09/12
14.7K0
视频直播| 搭建一个本地nginx服务器以及实现推流和拉流
iOS关于直播 - 搭建服务端解析
其实本人一直都想自己简单做一套直播(包括移动端和服务端)的开发测试,但是之前一直做得比较迷茫。最近偶然间来了灵感,瞬间解除了我很多疑惑。
CC老师
2022/01/11
6370
iOS关于直播 - 搭建服务端解析
【云+社区年度征文】利用nginx搭建推流服务器
博客已经许多月没有继续更新了,近期刚好有个粉丝在做直播实时流转发,需要构建推流服务器,像我提出了一些nginx构建的问题,捧着自己的粉丝请教(当时一头雾水:我只是个小安卓),但是还是专门花了一天的时间研究了下推流服务器(直播实时流服务器)RTMP流媒体服务器,现在网上现成的开源方案有很多,有SRS,Red5,wowoza,FMS等,我这里使用的是Nginx的rtmp插件实现实时流转发。
包子388321
2020/12/19
19.7K4
推荐阅读
相关推荐
2019-03-28 mac 用brew安装nginx
更多 >
领券
💥开发者 MCP广场重磅上线!
精选全网热门MCP server,让你的AI更好用 🚀
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验