Stream with HLS
HLS can work with VLC natively so you don't need rtmp dump to playback your live stream.
Note: HLS has about a 30 second delay.
Nginx.conf
OBS Broadcast SettingsCode:#user nobody; worker_processes 1; error_log logs/error.log debug; events { worker_connections 1024; } rtmp { server { listen 1935; application myapp { live on; hls on; hls_path /tmp/hls; hls_fragment 3s; hls_playlist_length 10s; hls_sync 200ms; allow publish all; allow play all; } } } # HTTP can be used for accessing RTMP stats http { include mime.types; default_type application/octet-stream; # ~test these later # sendfile on; # keepalive_timeout 65; server { listen 80; server_name localhost; error_page 500 502 503 504 /50x.html; location = /50x.html{ root html; } # This URL provides RTMP statistics in XML location /stat { rtmp_stat all; # Use this stylesheet to view XML as web page # in browser rtmp_stat_stylesheet stat.xsl; } location /stat.xsl { # XML stylesheet to view RTMP stats. # Copy stat.xsl wherever you want # and put the full directory path here root /usr/build/nginx-rtmp-module; } location /hls { # Serve HLS fragments types { application/vnd.apple.mpegurl m3u8; } alias /tmp/hls; expires -1; } } }
Mode: Live Stream
Streaming Service: Custom
Server: rtmp://Ubuntu_IP_HERE/myapp
Play Path/Stream Key (if any): livestream
You can view the stream here:
http://IPADDRESSHERE/hls/livestream.m3u8
In general you can use whatever key you want, you need to know it to watch the stream though. Unless you add some security to your nginx server, anyone can stream to it with any streamkey.Nice! But how i can change the key? (test by default)
Thank
You would need to add an exec function that starts ffmpeg to your nginx config. That converts the incoming stream to the mentioned 2500kbit and can send it to Twitch.i want determinded specified bitrate from nginx to twitch.tv like, obs to rtmp lan server 10kbitrate/10kbuffer and nginx to twitch 2500/2500 can perform it?
Hi,
Thank you for this fantastic tutorial! I'm doing some test and I have a problem when I try to broadcast my screen. My speed is 50MB/5MB (I think that it is enough to broadcast a 720p signal) and my server has 100MB/100MB, so it should be enough to broadcast to 1 o 2 viewers for now.
The problem is that every 60 seconds, almost 10 seconds I have a freeze image and the audio continues playing. So, do you have any suggestion? I tried on two different servers (in the same network, OVH) and it happens in both.
Thank you in advance!