ffmpeg+rtmp推流离线环境部署

nging-rtmp

给nginx的alfg/nginx-rtmp容器镜像修改配置nginx.conf

docker inspect xxx(容器name或id)
find / -name nginx/

找大串随机数后的/merged/etc/nginx路径
cd /var/lib/docker/overlay2/2929841208da65cc60b29c1c9237bd717c931de595a680498316b4b431f1bfed/merged/etc/nginx
ls
cat nginx.conf
vi nginx.conf

...
docker restart xxx

ffmpeg

1不建议禁用yasm安装,可能会导致莫名的bug,老老实实装yasm

禁用yasm安装(参考)./configure --enable-shared --prefix=/usr/local/ffmpeg --disable-yasm

安装yasm

下载地址http://yasm.tortall.net/Download.html

tar -xvzf yasm-1.3.0.tar.gz

cd yasm-1.3.0/

./configure

make && make install

2先装x264,不然编码会出问题

外网:git clone https://code.videolan.org/videolan/x264.git

cd x264

./configure --prefix=/usr/softinstall/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared

make  &&  make install

configure可能报如下错误:

[root@localhost x264]# ./configure --prefix=/usr/softinstall/x264/ --enable-static --enable-shared

Unknown option --enable-share, ignored Found no assembler Minimum > version is nasm-2.13

If you really want to compile without asm, configure with --disable-asm.

解决方案:

下载更新安装nasm新版本

外网:wget https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.gz

内网可先在外下载cp进来,文末附有下载好的文件

tar -xvzf nasm-2.14.tar.gz

cd nasm-2.14/

/configure

make  &&  make install

3正式装ffmpeg

tar -xjvf  ffmpeg-snapshot.tar.bz2

cd ffmpeg/

//  /monchickey/ffmpeg是我ffmpeg安装目录,也可以用/usr/local/ffmpeg

./configure --prefix=/monchickey/ffmpeg --enable-gpl --enable-shared --enable-libx264

make

make install

4配置环境变量

vi /etc/ld.so.conf

include ld.so.conf.d/*.conf
/monchickey/ffmpeg/lib       // /monchickey/ffmpeg 目录是我ffmpeg安装目录

 ldconfig  //执行加载使修改后的配置文件生效

vi /etc/profile

找个export 附近加入下边一行

export PATH=" /monchickey/ffmpeg/bin:$PATH"

source /etc/profile //保存后执行

 ffmpeg -version 测试ffmpeg是否成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值