kelinlang 5 years ago
parent 98d246558a
commit 7a6d9b01f0
  1. BIN
      StreamMedia/1080P.h265
  2. 0
      StreamMedia/ffmpeg编译.md
  3. 24
      StreamMedia/流媒体测试服务器搭建.md
  4. 31
      直播工具包/流媒体 nginx-1.9.9编译安装

Binary file not shown.

@ -37,3 +37,27 @@
进入路径:/release/linux/Debug 进入路径:/release/linux/Debug
执行:./MediaServer 执行:./MediaServer
备注:启动服务后会自动生成配置文件config.ini,如果运行服务打印log提示断开被占用需要修改对应端口号 备注:启动服务后会自动生成配置文件config.ini,如果运行服务打印log提示断开被占用需要修改对应端口号
# FFmpeg编译
## 配置
./configure --enable-ffplay --enable-gpl --enable-libx264 --enable-libx265 --enable-static --enable-shared --enable-debug --disable-yasm --prefix=/home/kelinlang/workspace/install/ffmpeg3.3.6
# 推拉流命令
./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 rtsp rtsp://192.168.2.162:5555/live/test
./ffmpeg -i rtsp://192.168.2.162:5555/live/test -c copy -f flv rtmp://192.168.2.162:1935/hls/test
# ts切片
./ffmpeg -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -bsf:v hevc_mp4toannexb /home/kelinlang/workspace/testFiles/E1h265.ts
./ffmpeg -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c:v libx265 -c:a aac -strict -2 -f hls -hls_list_size 0 -hls_time 5 /home/kelinlang/workspace/testFiles/E1h265_hls_test_.m3u8
./ffmpeg -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f hls -hls_list_size 0 -hls_time 5 /home/kelinlang/workspace/testFiles/E1h265_hls_test_.m3u8

@ -44,10 +44,18 @@ ffmpeg -re -i E:\YunvaProject\视频文件\VID_20190104_111210.mp4 -f flv rtmp:/
./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/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.2.162:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f flv rtmp://192.168.2.162:1935/hls/test ./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f flv rtmps://192.168.2.199: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/1080P.h265 -c copy -f flv rtmp://192.168.0.18:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/1080P.h265 -c copy -f flv rtmp://192.168.2.162:1935/live/test
./ffmpeg -re -i /tmp/workspace/testFiles/E1h265.mp4 -c copy -f flv rtmp://192.168.2.199:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtsp://192.168.2.162:1935/live/test ./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtsp://192.168.2.162:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtsp://192.168.2.162:5555/live/test ./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtsp://192.168.2.162:5555/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1.mp4 -c copy -f rtsp rtsp://192.168.2.162:5555/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtmp://192.168.2.162:1936/live/test ./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtmp://192.168.2.162:1936/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtmp://192.168.2.162:1936/live/test ./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -c copy -f rtsp rtmp://192.168.2.162:1936/live/test
./ffmpeg -i rtsp://192.168.2.162:5555/live/test -c copy -f flv rtmp://192.168.2.162:1935/hls/test ./ffmpeg -i rtsp://192.168.2.162:5555/live/test -c copy -f flv rtmp://192.168.2.162:1935/hls/test
@ -64,7 +72,12 @@ ffmpeg -re -i E:\YunvaProject\视频文件\VID_20190104_111210.mp4 -f flv rtmp:/
~/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 ~/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
~/bin/ffmpeg -re -i rtsp://192.168.3.101/ch01 -c:v libx265 -profile:v main -c:a aac -b:a 128k -f flv /home/kiloview/ch01_h265.flv ~/bin/ffmpeg -re -i rtsp://192.168.3.101/ch01 -c:v libx265 -profile:v main -c:a aac -b:a 128k -f flv /home/kiloview/ch01_h265.flv
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
ffmpeg -re -i rtsp://192.168.3.38/ch01 -c:v libx265 -profile:v main -c:a aac -b:a 128k -f flv rtmp://192.168.0.18:1935/live/test
./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1h265.mp4 -vcodec copy -f mpegts "udp://192.168.2.200:1234?pkt_size=1316"
udp://@192.168.2.200:1234
端口查看命令:netstat -ntpl 端口查看命令:netstat -ntpl
@ -78,6 +91,9 @@ ffmpeg -re -i E:\YunvaProject\视频文件\VID_20190104_111210.mp4 -f flv rtmp:/
./ffplay rtsp://192.168.2.162:5555/live/test ./ffplay rtsp://192.168.2.162:5555/live/test
./ffplay http://192.168.2.162:8080/hls/test.m3u8 ./ffplay http://192.168.2.162:8080/hls/test.m3u8
转码
ffmpeg -i /home/kelinlang/workspace/testFiles/E1.mp4 -c:v libx265 -b:v 5000k /home/kelinlang/workspace/testFiles/E1_h265_test.mp4
重封装 重封装
./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 -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 -re -i /home/kelinlang/workspace/testFiles/E1.mp4 -i /home/kelinlang/workspace/testFiles/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 /home/kelinlang/workspace/testFiles/tstest.ts ./ffmpeg -re -i /home/kelinlang/workspace/testFiles/E1.mp4 -i /home/kelinlang/workspace/testFiles/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 /home/kelinlang/workspace/testFiles/tstest.ts
@ -88,8 +104,19 @@ FFmpeg编译
./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpeg ./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpeg
./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpeg3.3 ./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpeg3.3
./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpegDev/3.3 ./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpegDev/3.3
./configure --enable-shared --enable-static --enable-ffplay --prefix=/home/kelinlang/workspace/install/ffmpegDev/master ./configure --enable-shared --enable-static --enable-ffplay --enable-libx264 --enable-libx265 --enable-gpl --prefix=/home/kelinlang/workspace/install/ffmpegDev/master
./configure --enable-gpl --enable-libx264 --enable-libx265 --enable-static --enable-shared --enable-ffplay --disable-yasm --prefix=/home/kelinlang/workspace/install/ffmpeg3.3.6
./configure --enable-gpl --enable-libx264 --enable-libx265 --enable-ffplay --disable-yasm --prefix=/home/kelinlang/workspace/install/ffmpeg3.3.6
复制命令
scp ffmpeg-3.3.6.tar.xz kelinlang@192.168.2.162:~/
scp ffmpeg-3.3.6.tar.xz kiloview@192.168.0.18:~/
sudo cp libx265.a libx265.so libx265.so.184 ../ -rfpv
linux打补丁
patch -p1 < 0003-The-RTMP-protocol-extensions-for-H.265-HEVC.patch
git config credential.helper store git config credential.helper store
git rm -r --cached git rm -r --cached

Loading…
Cancel
Save