Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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
- #user nobody;
- worker_processes 1;
- error_log logs/error.log debug;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- server {
- listen 8080;
- server_name localhost;
- # sample handlers
- #location /on_play {
- # if ($arg_pageUrl ~* localhost) {
- # return 201;
- # }
- # return 202;
- #}
- #location /on_publish {
- # return 201;
- #}
- #location /vod {
- # alias /var/myvideos;
- #}
- # rtmp stat
- location /stat {
- rtmp_stat all;
- rtmp_stat_stylesheet stat.xsl;
- }
- location /stat.xsl {
- # you can move stat.xsl to a different location
- root /usr/build/nginx-rtmp-module;
- }
- # rtmp control
- location /control {
- rtmp_control all;
- }
- # Client (VLC etc.) can access HLS here.
- location /live {
- # Serve HLS fragments
- types {
- application/vnd.apple.mpegurl m3u8;
- video/mp2t ts;
- }
- root /tmp;
- add_header Cache-Control no-cache;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- }
- rtmp {
- server {
- listen 1935;
- ping 30s;
- notify_method get;
- chunk_size 4096;
- application live {
- live on;
- record off;
- # sample play/publish handlers
- #on_play http://localhost:8080/on_play;
- #on_publish http://localhost:8080/on_publish;
- allow publish *MYIP*;
- exec_push ffmpeg -i rtmp://tubentertain.com/live/$name -vcodec libx264 -vprofile baseline;
- # sample recorder #recorder rec1 {
- # record all;
- # record_interval 30s;
- # record_path /tmp;
- # record_unique on;
- #}
- # sample HLS
- hls on;
- hls_path /tmp/hls;
- hls_sync 100ms; }
- # Video on demand
- #application vod {
- # play /var/Videos;
- #}
- # Video on demand over HTTP
- #application vod_http {
- # play http://localhost:8080/vod/;
- #}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement