文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

python+ngnix+ffmpeg+

2023-01-31 04:05

关注
  1. cd /opt
  2. 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
  3. yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel gtk*
  4. wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
  5. tar xvf Python-2.7.9.tar.xz
  6. cd Python-2.7.9
  7. ./configure –prefix=/usr/local/ -enable-shared CFLAGS=-fPIC
  8. make
  9. make install
  10. make clean
  11. mv /usr/bin/python /usr/bin/python2.6
  12. ln -s /usr/local/bin/python2.7 /usr/bin/python
  13. vi /usr/bin/yum
  14. 将文件头部的#!/usr/bin/python改成#!/usr/bin/python2.6
  15. 输入python进行验证,如果报错:libpython2.7.so.1.0: cannot open shared object file 解决方案:vi /etc/ld.so.conf 然后添加文本:/usr/local/lib 然后保存并退出
  16. 输入命令:/sbin/ldconfig
  17. 输入命令:/sbin/ldconfig -v
  18. 输入命令 python -V查看python是否安装正确,并查看版本

安装pip

  1. cd /opt
  2. wget https://bootstrap.pypa.io/get-pip.py
  3. python get-pip.py
  4. 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

  1. cd /opt
  2. yum -y install wget mysql-devel python-devel
  3. wget https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
  4. unzip MySQL-python-1.2.5.zip
  5. cd MySQL-python-1.2.5
  6. chmod -R 775 *
  7. python setup.py build
  8. 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-src/faac-1.28/faac-1.28.tar.gz
  1. yum install yasm
  2. 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
  3. yum install gd-devel
  1. tar xzvf libogg-1.3.2.tar.gz
  2. cd ./libogg-1.3.2
  3. ./configure
  4. make && make install
  1. tar xzvf libtheora-1.2.0alpha1.tar.gz
  2. cd ./libtheora-1.2.0alpha1
  3. ./configure
  4. make && make install
  1. tar xzvf yamdi-1.4.tar.gz
  2. cd yamdi-1.4
  3. make && make install
  1. tar xzvf lame-3.99.5.tar.gz
  2. cd ./lame-3.99.5
  3. ./configure
  4. make&&make install
  1. tar jxf last_x264.tar.bz2
  2. cd ./x264-snapshot-20170309-2245/
  3. ./configure --enable-shared --disable-asm
  4. make && make install
  1. tar xzvf faac-1.28.tar.gz
  2. ./configure
  3. make
  4. 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复原
  1. tar zxvf ffmpeg-2.8.tar.gz
  2. cd ffmpeg-2.8
  3. PKG_CONFIG_PATH=/usr/local/ffmpeg_build/lib/pkgconfig
  4. export PKG_CONFIG_PATH
  5. ./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
  6. make -j8
  7. make install
  1. tar zxvf nginx.tar.gz
  2. 下载zlib-1.2.8,pcre-8.34,nginx-tfs-master(需要连接tfs才下载),nginx-rtmp-module至mnt下
  3. ./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
  4. make -j8
  5. make install

配置nginx

  1. git clone https://github.com/johnf/m3u8-segmenter
  2. cd m3u8-segmenter
  3. PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  4. gcc -Wall -g -I/usr/local/ffmpeg/include m3u8-segmenter.c -o segmenter -L/usr/local/ffmpeg/lib -lavformat
  5. cp ./segmenter /usr/local/bin/
  1. git clone https://github.com/jwplayer/jwplayer.git
  2. git remote add upstream https://github.com/jwplayer/jwplayer
  3. npm install -g grunt
  4. yum install grunt
  5. wget http://the5fireblog.b0.upaiyun.com/staticfile/swfobject.js
  6. wget http://www.the5fire.com/static/demos/swf/HLSProviderOSMF.swf
  7. wget http://www.the5fire.com/static/demos/swf/StrobeMediaPlayback.swf
阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯