首页 > 代码库 > 用ffmpeg推流到nginx

用ffmpeg推流到nginx

用ffmpeg推流到nginx

【1】第一个是推到了上面配置的live节点上:【RTMP模块】

ffmpeg -i /data/recorded_flvs/1028_test8-1475221725.flv -c:v libx264 -b:v 500k -c:a libfdk_aac -b:a 64k  -f flv rtmp://120.26.206.180/live/strea123.flv

说明:红色为需要推送的文件,绿色为RTMP流,

运行成功界面:

技术分享

【2】第二个推送到hls上:

ffmpeg -i /data/recorded_flvs/1028_test8-1475221725.flv -c:v libx264 -b:v 500k -c:a libfdk_aac -b:a 64k  -f flv rtmp://120.26.206.180/hls/hls123.flv

[3]测试笔记

rtmp://120.26.99.151/live/100022http://120.26.99.151/hls/100022.m3u8http://120.26.99.151/hls/100022.m3u8rtmp://120.26.206.180/live2sewise.amai8.comExample of line-chartsign-language======================================================================================================================================ALIYUN:rtmp://stream.amaitech.com/app-name2/video-name?vhost=testzhibo.amai8.com&auth_key=1475307928-0-0-a685d414178e8272a01af3781ec01000OBS:rtmp://stream.amaitech.com/app-name2KEY:video-name?vhost=testzhibo.amai8.com&auth_key=1475307928-0-0-a685d414178e8272a01af3781ec01000剔流地址:http://stream.amailive.com/rtmp/controllortnoc/drop/client?app=live&name=100015============================================================================================================================================================================================================================================================================AMAI:rtmp://120.26.206.180/live/test?username=123456&password=123456OBS:rtmp://120.26.206.180/liveKEY:test?username=123456&password=123456test?username=tinywan&password=123456&sign=8935737e61b6fdd586cdab3b15d79633剔流地址:http://120.26.206.180/rtmp/controllortnoc/drop/client?app=live&name=tinywan======================================================================================================================================test?username=amai&password=123456&sign=ce020aa5a92e793156651c893ad887ce域名:testzhibo.amai8.com =>IP: 120.26.206.180on_publish http://sewise.amai8.com/authcheck/index; test?user=111&pass=111$user = isset($_GET[user]) ? $_GET[user] : ‘‘;$pass = isset($_GET[pass]) ? $_GET[pass] : ‘‘;流程图:【1】推流机制:push_flow_mechanism【2】域名:Domainname【3】源站:sourcestation【4】应用名称(可以理解成打流节点live1、live2):appname【5】打流名称:streamname【6】安全防护链:======================================================================================================================================rtmp://120.26.206.180/live/8888_test001?tokenSecret=8935737e61b6fdd586cdab3b1&tokenTime=c893ad8(1)originalUrl = rtmp://120.26.206.180/live/(2)streamId = 1028_test1001(3)tokenSecret= 8935737e61b6fdd586cdab3b1(4)tokenTime=c893ad8()newRtmp:originalUrl+streamId+tokenSecret+tokenTimestartTime : 2016-09-30 10:00:11(1475200811)expire :300exTime:14752011112016-09-30 10:10:28 (1475201428)2016/9/30 10:15:28短信接口:【0】http://wechatu.xd107.com/home/index/index 【TP】1】http://sewise.amai8.com/authcheck/noticeevent 【Phalcon】record all; record_unique on;record_max_size 512M;record_path /data/recorded_flvs;ffmpeg –i stream-1475224333.flv -2 -c:v libx264 -c:a aac -f flv rtmp://120.26.206.180/live/stream-1475224333.flvffmpeg -i $FILE -c:v libx264 -b:v 500k -c:a libfdk_aac -b:a 64k  -f flv rtmp://$IP/live/$DEVICE_IDffmpeg -i stream-1475224333.flv -c:v libx264 -b:v 500k -c:a libfdk_aac -b:a 64k  -f flv rtmp://120.26.206.180/live/stream1234ffmpeg -re -i "D:\download\film\aqgy\02.mp4" -vcodec libx264 -vprofile baseline -acodec aac -ar 44100 -strict -2 -ac 1 -f flv -s 1280x720 -q 10 rtmp://server:1935/myapp/test1ffmpeg -re -i "D:\download\film\aqgy\02.mp4" -vcodec libx264 -vprofile baseline -acodec aac  -ar 44100 -strict -2 -ac 1 -f flv -s 1280x720 -q 10 rtmp://ip:1935/hls/test2  

 

用ffmpeg推流到nginx