lidabo

通过录像文件模拟直播源,通过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

 

可以直播了

 

分类:

技术点:

相关文章:

  • 2021-10-26
  • 2021-07-29
  • 2021-11-23
  • 2021-12-05
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-12-13
  • 2021-12-13
  • 2021-11-11
  • 2021-12-13
相关资源
相似解决方案