基于CentOS7.8.2003搭建nginx-rtmp-ffmpeg流服务器

本文详细介绍了在CentOS7.8.2003上如何搭建Nginx-rtmp-ffmpeg流服务器,包括安装ffmpeg、配置nginx-rtmp模块,以及推拉流验证,确保流媒体服务的正常运行。
摘要由CSDN通过智能技术生成

CentOS7.8.2003 搭建Nginx-rtmp-ffmpeg流服务器

查看系统版本

[root@VM-0-8-centos ~]# cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)

安装ffmpeg

注: 此 ffmpeg 安装方式适用于CentOS 7

参考:CentOS中yum安装ffmpeg

准备环境

安装EPEL Release,因为安装需要使用其他的repo源,所以需要EPEL支持:

[root@VM-0-8-centos nginx-rtmp-ffmpeg]# yum install -y epel-release
	...........                                                          
Complete!

#如果出现缺少Code提示,可以:

sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

安装完成之后,可以查看是否安装成功

[root@VM-0-8-centos /]# yum repolist
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.yun-idc.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
repo id                     repo name                         				  		 status
base/7/x86_64              CentOS-7 - Base                      					 10070
epel/x86_64                Extra Packages for Enterprise Linux 7 - x86_64            13426
extras/7/x86_64            CentOS-7 - Extras                                          413
updates/7/x86_64           CentOS-7 - Updates                                         1125
repolist: 27758
安装Nux-Dextop源

由于CentOS没有官方FFmpeg rpm软件包,所以使用第三方YUM源(Nux Dextop)完成此工作。

#导入一个Code
[root@VM-0-8-centos nginx-rtmp-ffmpeg]# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
#安装nux-dextop 源
[root@VM-0-8-centos nginx-rtmp-ffmpeg]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Retrieving http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:nux-dextop-release-0-5.el7.nux   ################################# [100%]

   
#查看repo源是否安装成功
[root@VM-0-8-centos nginx-rtmp-ffmpeg]# yum repolist
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.yun-idc.com
 * extras: mirrors.aliyun.com
 * nux-dextop: li.nux.ro
 * updates: mirrors.aliyun.com
repo id                     repo name                         				  		 status
base/7/x86_64              CentOS-7 - Base                      					 10070
epel/x86_64                Extra Packages for Enterprise Linux 7 - x86_64            13426
extras/7/x86_64            CentOS-7 - Extras                                          413
nux-dextop/x86_64          Nux.Ro RPMs for general desktop use                        2724
updates/7/x86_64           CentOS-7 - Updates                                         1125
repolist: 27758
安装ffmpeg
#yum安装ffmpeg:
[root@VM-0-8-centos nginx-rtmp-ffmpeg]# yum install ffmpeg ffmpeg-devel -y

#安装完成后检查ffmpeg 版本: 
[root@VM-0-8-centos /]# ffmpeg -version
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avre
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值