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是否成功