You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SoftwareEngineering/直播工具包/流媒体 nginx-1.9.9编译安装

63 lines
4.4 KiB

5 years ago
1.源码下载,放同一路径
https://github.com/AlexWoo/nginx-toolkit-module.git
https://github.com/nats-io/nginx-nats.git
https://github.com/AlexWoo/nginx-client-module.git
https://github.com/AlexWoo/nginx-multiport-module.git
https://github.com/im-pingo/nginx-rtmp-module.git
tar -zxvf xxxx.tar.gz
2.执行下面命令配置
./configure --prefix=/home/kelinlang/workspace/install/nginx_rtmp/nginx-1.9.9 --with-pcre=/home/kelinlang/workspace/server/nginx/pcre-8.34 --with-openssl=/home/kelinlang/workspace/server/nginx/openssl-1.0.2d --add-module=/home/kelinlang/workspace/server/nginx/nginx-rtmp-module
./configure --prefix=/home/kelinlang/workspace/install/nginx_rtmp/nginx-1.9.9 --with-pcre=/home/kelinlang/workspace/server/nginx/pcre-8.34 --with-openssl=/home/kelinlang/workspace/server/nginx/openssl-1.0.2d --add-module=/home/kelinlang/workspace/server/nginx/nginx-rtmp-module --with-cc-opt="-Wno-error"
./configure --prefix=/home/kelinlang/workspace/install/nginx_rtmp/nginx-1.9.9 --with-pcre=/home/kelinlang/workspace/server/nginx/pcre-8.34 --with-openssl=/home/kelinlang/workspace/server/nginx/openssl-1.0.2d --add-module=/home/kelinlang/workspace/server/nginx/nginx-rtmp-module --without-http_gzip_module
./configure --prefix=/home/kelinlang/workspace/install/nginx_rtmp/nginx-1.9.9 --with-pcre=/home/kelinlang/workspace/server/nginx/pcre-8.34 --with-openssl=/home/kelinlang/workspace/server/nginx/openssl-1.0.2d --add-module=/home/kelinlang/workspace/server/nginx/nginx-rtmp-module --add-module=/home/kelinlang/workspace/server/nginx/nginx-rtmp-module/hls
1.17.6版本配置
./configure --prefix=/home/kelinlang/workspace/install/nginx_rtmp/nginx-1.17.6 --add-module=../nginx-client-module --add-module=../nginx-multiport-module --add-module=../nginx-toolkit-module --add-module=../nginx-rtmp-module --with-cc-opt="-Wno-error"
3. 执行make -j8&& make install
错误解决:/home/vagrant/nginx-1.11.2/objs/Makefile 修改如下
./configure --with-cc-opt="-Wno-error"
CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I/home/kelinlang/workspace/server/nginx/nginx-rtmp-module
4.rtmp://192.168.3.157:1395/mylive/rtmpstream
5.启动
6.查进程 ps -ef | grep nginx
复制状态html:cp /home/kelinlang/workspace/server/nginx/nginx-rtmp-module/stat.xsl html/
网页查看状态:http://192.168.2.162:8080/rtmp_stat
7.推流
ffmpeg -re -i E:\YunvaProject\视频文件\VID_20190104_111210.mp4 -f flv rtmp://192.168.3.157:1395/mylive/rtmpstream
5 years ago
./ffmpeg -re -i ./E1.mp4 -c copy -f flv rtmp://192.168.2.162:1935/live/test
5 years ago
./ffmpeg -re -i ./E1h265.mp4 -f flv rtmp://192.168.2.162:1935/live/test
./ffmpeg -re -i ./E1.mp4 -f flv rtmp://192.168.0.18:1935/live/test
./ffmpeg -re -i ./E1h265.mp4 -f flv rtmp://192.168.0.18:1935/live/test
5 years ago
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1.mp4 -f flv rtmp://192.168.0.18:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1.mp4 -c copy -f flv rtmp://192.168.0.18:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1.mp4 -c copy -f flv rtmp://192.168.2.162:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f flv rtmp://192.168.2.162:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f flv rtmp://192.168.0.18:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f flv /home/kelinlang/workspace/testFiles/E1h265.flv
./ffmpeg -re -i rtsp://192.168.3.101/ch01 -c:v libx265 -c:a aac -b:a 128k -f flv rtmp://192.168.0.18:1935/live/test
./ffmpeg -re -i rtsp://192.168.3.101/ch01 -c:v -c:a aac -b:a 128k -f flv rtmp://192.168.0.18:1935/live/test
~/bin/ffmpeg -re -i rtsp://192.168.3.101/ch01 -c:v libx265 -profile:v main -c:a aac -b:a 128k -f flv rtmp://192.168.2.162:1935/live/test
5 years ago
端口查看命令:netstat -ntpl
5 years ago
8.播放
./ffplay /home/kelinlang/workspace/testFiles/E1.mp4
./ffplay /home/kelinlang/workspace/testFiles/E1h265.mp4
./ffplay rtmp://192.168.2.162:1935/live/test
5 years ago
重封装
./ffmpeg -re -i ./E1.mp4 -i ./Record-null.ts -map 0:0 -map 0:1 -map 1:0 -map 1:1 -c copy -program title=CCTV1:program_num=1:st=0:st=1 -program title=CCTV2:program_num=2:st=2:st=3 -f mpegts "udp://192.168.2.34:1234?pkt_size=1316"
FFmpeg编译
5 years ago
./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpeg