python+ngnix+ffmpeg+
短信预约 -IT技能 免费直播动态提醒
- cd /opt
- yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm
- yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel gtk*
- wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
- tar xvf Python-2.7.9.tar.xz
- cd Python-2.7.9
- ./configure –prefix=/usr/local/ -enable-shared CFLAGS=-fPIC
- make
- make install
- make clean
- mv /usr/bin/python /usr/bin/python2.6
- ln -s /usr/local/bin/python2.7 /usr/bin/python
- vi /usr/bin/yum
- 将文件头部的#!/usr/bin/python改成#!/usr/bin/python2.6
- 输入python进行验证,如果报错:libpython2.7.so.1.0: cannot open shared object file 解决方案:vi /etc/ld.so.conf 然后添加文本:/usr/local/lib 然后保存并退出
- 输入命令:/sbin/ldconfig
- 输入命令:/sbin/ldconfig -v
- 输入命令 python -V查看python是否安装正确,并查看版本
安装pip
- cd /opt
- wget https://bootstrap.pypa.io/get-pip.py
- python get-pip.py
- ln -s /usr/local/bin/pip2.7 /usr/bin/pip
安装python依赖包
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple beautifulsoup4
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple selenium
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple thrift
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple command
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple supervisor
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple uwsgi
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple lxml
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple flask
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple supervisor
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple kafka
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple multiprocessing
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wget
pip install -U flask-cors
安装MySQLdb
- cd /opt
- yum -y install wget mysql-devel python-devel
- wget https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
- unzip MySQL-python-1.2.5.zip
- cd MySQL-python-1.2.5
- chmod -R 775 *
- python setup.py build
- python setup.py install
软件包 | 命令 |
---|---|
ffmpeg2.8 | wget https://www.ffmpeg.org/releases/ffmpeg-2.8.tar.gz |
libtheora-1.2.0 | wget http://downloads.xiph.org/releases/theora/libtheora-1.2.0alpha1.tar.gz |
liboggz-1.3.2 | wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz |
yamdi-1.4 | wget http://sourceforge.net/projects/yamdi/files/yamdi/1.4/yamdi-1.4.tar.gz |
lame-3.99.5 | wget https://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz |
libx264 | wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 |
libfacc | wget https://downloads.sourceforge.net/project/faac/faac-class="lazy" data-src/faac-1.28/faac-1.28.tar.gz |
- yum install yasm
- yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm
- yum install gd-devel
- tar xzvf libogg-1.3.2.tar.gz
- cd ./libogg-1.3.2
- ./configure
- make && make install
- tar xzvf libtheora-1.2.0alpha1.tar.gz
- cd ./libtheora-1.2.0alpha1
- ./configure
- make && make install
- tar xzvf yamdi-1.4.tar.gz
- cd yamdi-1.4
- make && make install
- tar xzvf lame-3.99.5.tar.gz
- cd ./lame-3.99.5
- ./configure
- make&&make install
- tar jxf last_x264.tar.bz2
- cd ./x264-snapshot-20170309-2245/
./configure --enable-shared --disable-asm
- make && make install
- tar xzvf faac-1.28.tar.gz
- ./configure
- make
- make install
注:如果报错libstdc++.so:could not read symbols: File in wrong format,可以用file命令查看该文件,可以看到该库是32位的,而我们编译的libfaac是64位的,所有只需使用64位库就行,网上有个方法是 make clean all LDFLAGS=”-L/usr/lib64 -L/lib64” 还是用的lib下的libstdc++.so~~,只能用野蛮的方式解决了。。。先将lib下的libstdc++.so备份为libstdc++.so.bak,再将lib64下的libstdc++.so拷贝一份到lib目录下,编译libfaac一切正常!大功告成,不要忘了将libstdc++.so复原
- tar zxvf ffmpeg-2.8.tar.gz
- cd ffmpeg-2.8
- PKG_CONFIG_PATH=/usr/local/ffmpeg_build/lib/pkgconfig
- export PKG_CONFIG_PATH
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libtheora --enable-nonfree --enable-pic --enable-shared --enable-libx264 --enable-libmp3lame --enable-libfaac
- make -j8
- make install
- tar zxvf nginx.tar.gz
- 下载zlib-1.2.8,pcre-8.34,nginx-tfs-master(需要连接tfs才下载),nginx-rtmp-module至mnt下
./configure --user=www --group=www --prefix=/opt/c_nginx --with-http_stub_status_module --with-zlib=/mnt/zlib-1.2.8 --with-pcre=/mnt/pcre-8.34 --with-http_stub_status_module --with-http_image_filter_module --add-module=/mnt/nginx-tfs-master/ --add-module=/mnt/nginx-rtmp-module --with-http_flv_module --with-http_mp4_module --with-http_ssl_module
- make -j8
- make install
配置nginx
- git clone https://github.com/johnf/m3u8-segmenter
- cd m3u8-segmenter
- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
- gcc -Wall -g -I/usr/local/ffmpeg/include m3u8-segmenter.c -o segmenter -L/usr/local/ffmpeg/lib -lavformat
- cp ./segmenter /usr/local/bin/
- git clone https://github.com/jwplayer/jwplayer.git
- git remote add upstream https://github.com/jwplayer/jwplayer
- npm install -g grunt
- yum install grunt
- wget http://the5fireblog.b0.upaiyun.com/staticfile/swfobject.js
- wget http://www.the5fire.com/static/demos/swf/HLSProviderOSMF.swf
- wget http://www.the5fire.com/static/demos/swf/StrobeMediaPlayback.swf
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341