You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.3 KiB

  1. user nginx;
  2. worker_processes auto;
  3. load_module modules/ngx_rtmp_module.so;
  4. error_log /var/log/nginx/error.log notice;
  5. pid /var/run/nginx.pid;
  6. events {
  7. worker_connections 1024;
  8. }
  9. http {
  10. include /etc/nginx/mime.types;
  11. default_type application/octet-stream;
  12. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  13. '$status $body_bytes_sent "$http_referer" '
  14. '"$http_user_agent" "$http_x_forwarded_for"';
  15. access_log /var/log/nginx/access.log main;
  16. sendfile on;
  17. #tcp_nopush on;
  18. keepalive_timeout 65;
  19. #gzip on;
  20. include /etc/nginx/conf.d/*.conf;
  21. }
  22. # TCP/UDP proxy and load balancing block
  23. #
  24. #stream {
  25. # Example configuration for TCP load balancing
  26. #upstream stream_backend {
  27. # zone tcp_servers 64k;
  28. # server backend1.example.com:12345;
  29. # server backend2.example.com:12345;
  30. #}
  31. #server {
  32. # listen 12345;
  33. # status_zone tcp_server;
  34. # proxy_pass stream_backend;
  35. #}
  36. #}
  37. rtmp {
  38. server {
  39. listen 1935;
  40. chunk_size 4000;
  41. application app {
  42. live on;
  43. #exec ffmpeg -i rtmp://localhost/app/$name
  44. # -c:a libmp3lame -b:a 32k -c:v libx264 -b:v 128K
  45. # -f flv rtmp://localhost/hls/$name_low
  46. # -c:a libmp3lame -b:a 64k -c:v libx264 -b:v 256k
  47. # -f flv rtmp://localhost/hls/$name_mid
  48. # -c:a libmp3lame -b:a 128k -c:v libx264 -b:v 512K
  49. # -f flv rtmp://localhost/hls/$name_hi
  50. # -c:a libmp3lame -b:a 128k -c:v libx264 -b:v 512K
  51. # -f flv rtmp://localhost/dash/$name_dash;
  52. #exec ffmpeg -i rtmp://localhost:1935/$app/$name
  53. # -c:a libmp3lame -b:a 128k -c:v libx264 -b:v 512K
  54. # -f flv rtmp://localhost/dash/$name_dash;
  55. }
  56. application hls {
  57. live on;
  58. hls on;
  59. hls_path /tmp/hls;
  60. hls_nested on;
  61. hls_variant _low BANDWIDTH=160000;
  62. hls_variant _low BANDWIDTH=320000;
  63. hls_variant _low BANDWIDTH=640000;
  64. }
  65. application dash {
  66. live on;
  67. dash on;
  68. dash_path /tmp/dash;
  69. dash_nested on;
  70. }
  71. }
  72. }