分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

[FMS]使用ffmpeg来完成对flv、mp4、mp3等格式的转化,使用ffmpeg或segmenter完成对视频/音频格式文件的切割,切割为m3u8格式及ts文件

1、 为何要使用HTTP Live Streaming

可以参考wikipedia

HTTP Live Streaming(缩写是 HLS)是一个由苹果公司提出的基于HTTP的流媒体 网络传输协议。是苹果公司QuickTime X和iPhone软件系统的一部分。它的工作原理是把整个流分成一个个小的基于HTTP的文件来下载,每次只下载一些。当媒体流正在播放时,客户端可以选择从许多不同的备用源中以不同的速率下载同样的资源,允许流媒体会话适应不同的数据速率。在开始一个流媒体会话时,客户端会下载一个包含元数据的extended M3U (m3u8) playlist文件,用于寻找可用的媒体流。

HLS只请求基本的HTTP报文,与实时传输协议(RTP)不同,HLS可以穿过任何允许HTTP数据通过的防火墙或者代理服务器。它也很容易使用内容分发网络来传输媒体流。

2、 HTTP Live Streaming技术方案

HTTP服务:使用Nginx提供HTTP服务,通过使用nginx-rtmp-module https://github.com/arut/nginx-rtmp-module 来增加对HLS的支持

使用ffmpeg来完成对flv、mp4、mp3等格式的转化,使用ffmpeg或segmenter完成对视频/音频格式文件的切割,切割为m3u8格式及ts文件

3、 准备工作

操作系统CentOS

3.1、准备安装删除已安装包

yum erase ffmpeg x264 x264-devel

3.2、安装各种依赖包

yum install gcc make nasm pkgconfig wget curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel libtool mhash.x86_64 perl-Digest-SHA1.x86_64 pcre.i386 pcre.x86_64 pcre-devel.i386 pcre-devel.x86_64

3.3、安装git

wget -O git-devel.zip https://github.com/msysgit/git/archive/devel.zip

unzip git-devel.zip

cd git-devel/

autoconf

./configure

make

make install

3.4、创建安装包目录

mkdir ~/ffmpeg-source

4、 安装ffmpeg及其依赖包

4.1、Yasm

cd ~/ffmpeg-source

wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz

tar xzvf yasm-1.2.0.tar.gz

cd yasm-1.2.0

./configure

make

make install

4.2、x264

cd ~/ffmpeg-source

git clone git://git.videolan.org/x264

cd x264

./configure –enable-shared

make

make install

4.3、LAME

cd ~/ffmpeg-source

wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz

tar xzvf lame-3.99.5.tar.gz

cd lame-3.99.5

./configure –enable-nasm

make

make install

4.4、libogg

cd ~/ffmpeg-source

wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz

tar xzvf libogg-1.3.0.tar.gz

cd libogg-1.3.0

./configure

make

make install

4.5、libvorbis

cd ~/ffmpeg-source

wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

tar xzvf libvorbis-1.3.3.tar.gz

cd libvorbis-1.3.3

./configure

make

make install

4.6、libvpx

cd ~/ffmpeg-source

git clone http://git.chromium.org/webm/libvpx.git

cd libvpx

./configure –enable-shared

make

make install

4.7、 FAAD2

cd ~/ffmpeg-source

wget http://downloads.sourceforge.net/project/faac/faad2-src/faad2-2.7/faad2-2.7.tar.gz

tar zxvf faad2-2.7.tar.gz

cd faad2-2.7

./configure

make

make install

4.8、FAAC

cd ~/ffmpeg-source

wget http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.gz

tar zxvf faac-1.28.tar.gz

cd faac-1.28

./configure

make

make install

4.9、Xvid

cd ~/ffmpeg-source

wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz

tar zxvf xvidcore-1.3.2.tar.gz

cd xvidcore/build/generic

./configure

make

make install

4.10、FFmpeg

cd ~/ffmpeg-source

git clone git://source.ffmpeg.org/ffmpeg

cd ffmpeg

./configure –enable-version3 –enable-libvpx –enable-libfaac –enable-libmp3lame –enable-libvorbis –enable-libx264 –enable-libxvid –enable-shared –enable-gpl –enable-postproc –enable-nonfree –enable-avfilter –enable-pthreads

make

make install

ldconfig –v

5、 安装nginx及nginx-rtmp-module

  1. mkdir ~/nginx-source
  2. cd  ~/nginx-source
  3. wget http://nginx.org/download/nginx-1.2.4.tar.gz
  4. tar zxvf nginx-1.2.4.tar.gz
  5. wget -O nginx-rtmp-module.zip  https://github.com/arut/nginx-rtmp-module/archive/master.zip
  6. unzip nginx-rtmp-module.zip
  7. wget -O ngx_cache_purge.zip https://github.com/FRiCKLE/ngx_cache_purge/archive/master.zip
  8. unzip ngx_cache_purge.zip
  9. cd nginx-1.2.4
  10. ./configure –user=daemon –group=daemon –prefix=/usr/local/nginx-1.2.4/ –add-module=../nginx-rtmp-module-master –add-module=../nginx-rtmp-module-master/hls –add-module=../ngx_cache_purge-master  –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module –with-md5=/usr/lib –with-sha1=/usr/lib –with-http_gzip_static_module
  11. 在nginx.conf中增加rtmp模块的相关配置,配置例子
  12. rtmp {
  13. server {
  14. listen 1935;
  15. chunk_size 4000;
  16. # TV mode: one publisher, many subscribers
  17. application mytv {
  18. # enable live streaming
  19. live on;
  20. # record first 1K of stream
  21. record all;
  22. record_path /tmp/av;
  23. record_max_size 1K;
  24. # append current timestamp to each flv
  25. record_unique on;
  26. # publish only from localhost
  27. allow publish 127.0.0.1;
  28. deny publish all;
  29. #allow play all;
  30. }
  31. # Transcoding (ffmpeg needed)
  32. application big {
  33. live on;
  34. # On every pusblished stream run this command (ffmpeg)
  35. # with substitutions: $app/${app}, $name/${name} for application & stream name.
  36. #
  37. # This ffmpeg call receives stream from this application &
  38. # reduces the resolution down to 32×32. The stream is the published to
  39. # ‘small’ application (see below) under the same name.
  40. #
  41. # ffmpeg can do anything with the stream like video/audio
  42. # transcoding, resizing, altering container/codec params etc
  43. #
  44. # Multiple exec lines can be specified.
  45. exec /usr/local/bin/ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 32×32 -f flv rtmp://localhost:1935/small/${name};
  46. }
  47. application small {
  48. live on;
  49. # Video with reduced resolution comes here from ffmpeg
  50. }
  51. application mypush {
  52. live on;
  53. # Every stream published here
  54. # is automatically pushed to
  55. # these two machines
  56. #push rtmp1.example.com;
  57. #push rtmp2.example.com:1934;
  58. }
  59. application mypull {
  60. live on;
  61. # Pull all streams from remote machine
  62. # and play locally
  63. #pull rtmp://rtmp3.example.com pageUrl=www.example.com/index.html;
  64. }
  65. # video on demand
  66. application vod {
  67. play /var/flvs;
  68. }
  69. application vod2 {
  70. play /var/mp4s;
  71. }
  72. # Many publishers, many subscribers
  73. # no checks, no recording
  74. application videochat {
  75. live on;
  76. # The following notifications receive all
  77. # the session variables as well as
  78. # particular call arguments in HTTP POST
  79. # request
  80. # Make HTTP request & use HTTP retcode
  81. # to decide whether to allow publishing
  82. # from this connection or not
  83. on_publish http://localhost:8080/publish;
  84. # Same with playing
  85. on_play http://localhost:8080/play;
  86. # Publish/play end (repeats on disconnect)
  87. on_done http://localhost:8080/done;
  88. # All above mentioned notifications receive
  89. # standard connect() arguments as well as
  90. # play/publish ones. If any arguments are sent
  91. # with GET-style syntax to play & publish
  92. # these are also included.
  93. # Example URL:
  94. #   rtmp://localhost/myapp/mystream?a=b&c=d
  95. # record 10 video keyframes (no audio) every 2 minutes
  96. record keyframes;
  97. record_path /var/vc;
  98. record_max_frames 10;
  99. record_interval 2m;
  100. # Async notify about an flv recorded
  101. on_record_done http://localhost:8080/record_done;
  102. }
  103. # HLS
  104. # HLS requires libavformat & should be configured as&nbs

    给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

转 做自己的m3u8点播系统使用HTTP Live Streaming HLS技术)相关推荐

  1. [转]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)

    [FMS]使用ffmpeg来完成对flv.mp4.mp3等格式的转化,使用ffmpeg或segmenter完成对视频/音频格式文件的切割,切割为m3u8格式及ts文件 1. 为何要使用HTTP Liv ...

  2. 做自己的m3u8点播系统使用HTTP Live Streaming

    . 为何要使用HTTP Live Streaming 可以参考wikipedia HTTP Live Streaming(缩写是 HLS)是一个由苹果公司提出的基于HTTP的流媒体 网络传输协议.是苹 ...

  3. 做一个微信语音点播系统

    最近在做一个微信项目,接触到了微信公众平台.通过公众平台可以很方便的搭建一个功能完善的移动应用.昨天发现:开发者可使用手机号来申请接口测试帐号,体验高级接口. 这篇文章的应用将使用到高级接口中的语音识 ...

  4. 基于HTTP Live Streaming(HLS) 搭建在线点播系统

    from:http://blog.csdn.net/cdnight/article/details/39156711 基于HTTP Live Streaming(HLS) 搭建在线点播系统 chuan ...

  5. 完整的OTT直播点播系统都有哪些功能?

    说到 IPTV 或者OTT直播点播系 统的完整功能,要看针对什么运营者以及在什么样的环境中使用,针对的是什么人群,这样说的完整功能才是比较有意义的.这里小编只是对 IPTV/OTT 直播点播系统 ,可 ...

  6. 直播、点播系统开发项目总结(本地视频、抓包视频、直播推流、网络直播、平台搭建等相关问题点记录)

    项目需求: 1.客户端实现各种格式的直播源兼容问题(组播.单播下常见直播地址格式皆可播放),以及直播分类.播放记录等: 2.客户端实现视频分类(单个视频可属于多个分类下).多格式兼容.本地数据库播放缓 ...

  7. 适合影院的点播系统——点量OTT点播

    随着国内外电影的大卖,票房的收入不断增加,电影可谓是大众一项娱乐的方式,私人影院也就随之发展起来.私人影院的发展给人们带来了新的生活娱乐体验,两三个好友一个包厢,喝着饮料吃着爆米花,可以一起聊着剧情, ...

  8. 用Windows Media Service 9 实现VOD广播和点播系统(上)

    用Windows Media Service 9 实现VOD广播和点播系统(上) 2006-10-27 15:25 Windows 2003(.net)目前已经推出了多个评估版本供大家试用,而其中最令 ...

  9. 联讯机顶盒直播点播系统方案,智能机顶盒,智能电视客户端

    一.  概述 为适应现代社会校园快捷方便的直播.点播形式,威海联讯信息技术有限公司推出了联讯机顶盒直播点播系统:一台智能手机.一台pc机和一台联讯校园智能机顶盒.配合显示设备即可完成一个直播活动,直播 ...

最新文章

  1. 一个不错的安全评估站点vulnerabilityassessment.co.uk
  2. Selenium3自动化测试——4. 获取百度备案信息
  3. linux看进程所在,linux 查看进程所在目录
  4. 机器学习中为什么需要梯度下降_机器学习,梯度下降算法,问题引入
  5. 一个反编译工具Reflactor (.NET)
  6. UML模型中的图-行为图【交互图-序列图、协作图】
  7. 2019 年“浪潮杯”第十届山东省 ACM 省赛总结
  8. simpledateformat线程不安全_ArrayList为什么线程不安全?
  9. 修改eclipse配置文件properties编码格式
  10. python中module错误_python错误:“module”对象不可调用数学中心
  11. Markdown图片并排展示、图注对齐
  12. 弥合安全和开发间隙的四个关键点
  13. 持续集成:软件质量改进和风险降低之道
  14. 关闭所有的screen
  15. Mybatis-实现逆向代理
  16. python压缩视频_如何压缩视频大小?
  17. QQ输入法 for iPhone2.3
  18. 【时间之外】金融数据中心机房应对监管(最新出炉)
  19. 伯努利分布、二项分布和多项分布
  20. maven项目spring整合mybatis——最基础的方式

热门文章

  1. Three.js - 光源使用详解1(环境光 AmbientLight、点光源 PointLint)
  2. 区块链:“我还活在1994!”
  3. Flutter画中画自定义画中画
  4. 【原创】《矩阵的史诗级玩法》连载十六:二元二次方程一般式和圆锥曲线的关系(下)
  5. C#学习笔记之从入门到精通
  6. 前女友闺蜜给我发了一个压缩包,居然还带密码?暴力破解ZIP加密文件的密码!
  7. 7-2 群发邮件 (20 分)
  8. 解决微信环境下无法通过链接唤起App Store、微信访问App Store 链接白屏问题
  9. 【JAVA】TCP通信——发弹幕案例
  10. 张小龙:从FoxMail到WeChat