大家好,今天来为大家解答flash空间上传网站源码分享这个问题的一些问题点,包括flash 上传控件也一样很多人还不知道,因此呢,今天就来为大家分析分析,现在让我们一起来看看吧!如果解决了您的问题,还望您关注下本站哦,谢谢~
1、部署nginx
1.1准备环境
1.1.1服务器资源
服务名称:测试环境服务器
IP:[请查看资源分配文档]
操作系统:CentOS6.8×64
1.2安装nginx
1.2.1nginx下载
nginx下载
下载地址:nginx.org/en/download…
nginx-http-flv-module下载
下载地址:github.com/winshining/…
1.2.2nginx安装
把nginx-1.16.1.tar.gz和nginx-http-flv-module-1.2.7.tar.gz,上传到/opt/tools目录下
创建nginx目录
cd/opt/tools\n\ntar-zxvfnginx-http-flv-module-1.2.7.tar.gz-C/usr/local/nginx/
目录改名
mvnginx-http-flv-module-1.2.7nginx-http-flv-module
安装nginx所需依赖项
yum-yinstallgcc-c++\n\nyum-yinstallpcrepcre-devel\n\nyum-yinstallzlibzlib-devel\n\nyum-yinstallopensslopenssl-devel
安装nginx
./configure–prefix=/usr/local/nginx–add-module=/usr/local/nginx/nginx-http-flv-module\n\ncd/usr/local/nginx\n\nrtmp配置\nrtmp{\nout_queue4096;\nout_cork8;\nmax_streams128;\nserver{\nlisten1935;\napplicationlive{\nliveon;\nrecordoff;\ngop_cacheon;\n}\n}\n}\nhttp{\nincludemime.types;\ndefault_typeapplication/octet-stream;\nsendfileon;\nkeepalive_timeout65;\nserver{\nlisten80;http-flv的配置\nlocation/live{\nflv_liveon;\nchunked_transfer_encodingon;39;Transfer-Encoding:chunked&39;Access-Control-Allow-Origin&39;*&添加额外的HTTP头\nadd_header&39;&39;;vi/etc/sysconfig/iptables
添加以下内容:
-AINPUT-mstate–stateNEW-mtcp-ptcp–dport80-jACCEPT\\\n-AINPUT-mstate–stateNEW-mtcp-ptcp–dport1935-jACCEPT
重启防火墙
/usr/local/nginx/sbin/nginx
1.4.2重启nginx
/usr/local/nginx/sbin/nginx-sstop
1.4.4检验nginx
cd/opt/tools\n\ncdyasm-1.3.0\n\nmake&&makeinstall
解压安装ffmpeg:
tar-zxvfffmpeg-4.2.tar.gz\n\nmake&&makeinstall编译过程有点长,耐心等待…
将ffmpeg的lib加载到系统库:
ldconfig
将ffmpeg添加到环境变量中
ffmpegenv\nexportFFMPEG_HOME=/usr/local/ffmpeg\n\nexportPATH=$FFMPEG_HOME/bin:$PATH
使修改生效:
ffmpeg
3、ffmpeg推送流
3.1通过ffmpeg将rtsp转成rtmp推送到nginx
39;./swfs/SampleMediaPlayback.swf&39;600px&39;400px&39;high&39;39;name=&39;allowfullscreen=&39;\npluginspage=&39;\nflashvars=&39;\ntype=&39;wmode=&39;>\n</embed>\n</html>
3.1.2使用flv.js查看:
对应源码
<!DOCTYPEhtml>\n<html>\n<head>\n<metacontent=&34;http-equiv=&34;>\n<title>flv.jsdemo</title>\n<style>\n.mainContainer{\ndisplay:block;\nwidth:540px;\nmargin-left:auto;\nmargin-right:auto;\n}\n\n.centeredVideo{\ndisplay:block;\nwidth:100%;\nheight:306px;\nmargin-left:auto;\nmargin-right:auto;\nmargin-bottom:auto;\n}\n</style>\n</head>\n<body>\n<divclass=&34;>\n<videoname=&34;class=&34;id=&34;controlsautoplaymuted>\nYourbrowseristoooldwhichdoesn&34;./js/flv.min.js?v=2&39;videoElement&39;flv&39;http://192.168.133.130/live?app=live&stream=1019232&39;click&ffmpeg-re-rtsp_transporttcp-irtsp://username:password@ip:port-vcodech264-ccopy-flvflagsno_duration_filesize-fflvrtmp://127.0.0.1/live/1019232>/dev/null2>&1</dev/null&
好了,以上就是rtsp通过ffmpeg+nginx发布成rtmp和http-flv部署的过程了。
个人理解,可能也不够全面,班门弄斧了。
好了,今天就先到这里了!!!^_^
原文链接:rtsp通过ffmpeg+nginx发布成rtmp和http-flv部署文档-掘金
flash空间上传网站源码分享的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于flash 上传控件、flash空间上传网站源码分享的信息别忘了在本站进行查找哦。
