用ffmpeg推流到nginx
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用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/100022 http://120.26.99.151/hls/100022.m3u8 http://120.26.99.151/hls/100022.m3u8 rtmp://120.26.206.180/live2 sewise.amai8.com Example of line-chart sign-language ====================================================================================================================================== ALIYUN:rtmp://stream.amaitech.com/app-name2/video-name?vhost=testzhibo.amai8.com&auth_key=1475307928-0-0-a685d414178e8272a01af3781ec01000 OBS:rtmp://stream.amaitech.com/app-name2 KEY: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=123456 OBS:rtmp://120.26.206.180/live KEY:test?username=123456&password=123456 test?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.180 on_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+tokenTime startTime : 2016-09-30 10:00:11(1475200811) expire :300 exTime:1475201111 2016-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.flv ffmpeg -i $FILE -c:v libx264 -b:v 500k -c:a libfdk_aac -b:a 64k -f flv rtmp://$IP/live/$DEVICE_ID ffmpeg -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/stream1234 ffmpeg -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/test1 ffmpeg -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的主要内容,如果未能解决你的问题,请参考以下文章
利用ffmpeg推流到rtsp,再利用jmpeg在html界面上显示的解决办法
2Window下安装FFmpeg并实现将摄像头的流推流到SRS