Advertisement
Guest User

Untitled

a guest
May 26th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. #Heres my nginx.conf, with a file in public_html/live/stream.m3u8, RTMP works, m3u8 seems to just be a 40 second clip #rather than the livestream
  2. #user nobody;
  3. worker_processes 1;
  4.  
  5. error_log logs/error.log debug;
  6.  
  7. events {
  8. worker_connections 1024;
  9. }
  10.  
  11. http {
  12. include mime.types;
  13. default_type application/octet-stream;
  14.  
  15. sendfile on;
  16. keepalive_timeout 65;
  17.  
  18. server {
  19. listen 8080;
  20. server_name localhost;
  21.  
  22. # sample handlers
  23. #location /on_play {
  24. # if ($arg_pageUrl ~* localhost) {
  25. # return 201;
  26. # }
  27. # return 202;
  28. #}
  29. #location /on_publish {
  30. # return 201;
  31. #}
  32.  
  33. #location /vod {
  34. # alias /var/myvideos;
  35. #}
  36.  
  37. # rtmp stat
  38. location /stat {
  39. rtmp_stat all;
  40. rtmp_stat_stylesheet stat.xsl;
  41. }
  42. location /stat.xsl {
  43. # you can move stat.xsl to a different location
  44. root /usr/build/nginx-rtmp-module;
  45. }
  46.  
  47. # rtmp control
  48. location /control {
  49. rtmp_control all;
  50. }
  51.  
  52. # Client (VLC etc.) can access HLS here.
  53. location /live {
  54. # Serve HLS fragments
  55. types {
  56. application/vnd.apple.mpegurl m3u8;
  57. video/mp2t ts;
  58. }
  59. root /tmp;
  60. add_header Cache-Control no-cache;
  61. }
  62. error_page 500 502 503 504 /50x.html;
  63. location = /50x.html {
  64. root html;
  65. }
  66. }
  67. }
  68.  
  69. rtmp {
  70. server {
  71. listen 1935;
  72. ping 30s;
  73. notify_method get;
  74. chunk_size 4096;
  75.  
  76. application live {
  77. live on;
  78. record off;
  79. # sample play/publish handlers
  80. #on_play http://localhost:8080/on_play;
  81. #on_publish http://localhost:8080/on_publish;
  82. allow publish *MYIP*;
  83.  
  84. exec_push ffmpeg -i rtmp://tubentertain.com/live/$name -vcodec libx264 -vprofile baseline;
  85.  
  86. # sample recorder #recorder rec1 {
  87. # record all;
  88. # record_interval 30s;
  89. # record_path /tmp;
  90. # record_unique on;
  91. #}
  92. # sample HLS
  93. hls on;
  94. hls_path /tmp/hls;
  95. hls_sync 100ms; }
  96. # Video on demand
  97. #application vod {
  98. # play /var/Videos;
  99. #}
  100. # Video on demand over HTTP
  101. #application vod_http {
  102. # play http://localhost:8080/vod/;
  103. #}
  104. }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement