Win10 Nginx + FFmpegrtmp 视频推流

mac2024-07-10  51

首先抓取h264码流,可以查看链接:

https://blog.csdn.net/ding283595861/article/details/102831369

ffmpeg的安装,可以查看链接: https://blog.csdn.net/ding283595861/article/details/102834000 通过ffmpeg把H264视频转mp4,可以参考: https://www.cnblogs.com/yuancr/p/7272321.html ffmpeg -i test.h264 -vcodec copy -f mp4 test.mp4 下载 Nginx: 进入Nginx下载页面( http://nginx-win.ecsds.eu/download/ ),选择合适的版本下载。这里以 nginx 1.7.11.3 Gryphon 为例。下载完成后解压, 将解压后的目录重命名为“ nginx-1.7.11.3-Gryphon ”,并放到合适的路径下 ubuntu下安装Nginx的方法可以参考: https://blog.csdn.net/hu_feng903/article/details/80297821

下载服务器状态检查程序 stat.xsl 下载地址: https://github.com/arut/nginx-rtmp-module/ 将nginx-rtmp-module-master.zip解压后复制到目录:nginx-1.7.11.3-Gryphon下, 保证stat.xls的目录为: nginx-1.7.11.3-Gryphon\nginx-rtmp-module\stat.xsl Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器。 nginx-rmtp-module是Nginx服务器的流媒体插件。nginx通过rtmp模块提供rtmp服务, ffmpeg推送一个rtmp流到nginx, 然后客户端通过访问nginx来收看实时视频流

创建配置文件 conf\nginx-win-rtmp.conf 在目录 nginx-1.7.11.3-Gryphon\conf下创建 nginx-win-rtmp.conf配置文件,可以拷贝该链接的内容:

https://blog.csdn.net/ding283595861/article/details/102843690

启动Nginx服务器,打开cmd,执行下列两行命令: cd nginx-1.7.11.3-Gryphon nginx.exe -c conf\nginx-win-rtmp.conf 使用ffmpeg进行推流: ffmpeg -re -i aa.mp4 -vcodec libx264 -acodec aac -f flv rtmp://localhost:1935/live/home 拉流验证

9.1.使用ffplay进行拉流

ffplay -fs rtmp://localhost:1935/live/home

9.2. 使用VLC进行拉流

打开VLC,选择【媒体】 -> 【打开网络串流】,输入 rtmp://localhost:1935/live/home ,点击【播放】就可以看到流了,如果是远端电脑访问,直接请求:rtmp://192.168.5.156:1935/live/home

最新回复(0)