DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

通过录像文件模拟直播源,通过rtmp协议推送到nginx服务器

 nginx 配置文件 增加

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. rtmp {    
  2.     server {    
  3.         listen 1935;    
  4.        application hls {    
  5.              live on;    
  6.              hls on;    
  7.              hls_path /tmp/app;    
  8.              hls_fragment 5s;    
  9.   
  10.        }    
  11.     }    
  12. }    

 

http 下面增加

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. location /hls {    
  2.            #server hls fragments    
  3.            types{    
  4.              application/vnd.apple.mpegurl m3u8;    
  5.              video/mp2t ts;    
  6.            }    
  7.         alias /tmp/app;    
  8.         expires -1;    
  9.         }    

 

在 safari浏览器或者vlc中打开 测试地址:  http://192.168.1.105:8080/hls/test.m3u8

 

可以直播了

 

posted on 2017-02-16 13:25  DoubleLi  阅读(6174)  评论(0编辑  收藏  举报