Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nginx RTMP Setup
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
location /live {
types {
application/vnd.apple.mpegurl m3u8;
}
alias /home/hls/live;
add_header Cache-Control no-cache;
}
location /dash {
alias /home/dash/live;
add_header Cache-Control no-cache;
}
}
}
rtmp {
server {
listen 1935;
chunk size 8192;
application live {
live on;
allow publish 127.0.0.1;
allow publish all;
allow play all;
record all;
record_path /home/video_recordings;
record_unique on;
hls on;
hls_nested on;
hls_path /home/hls;
hls_fragment 10s;
dash on;
dash_path /home/dash;
dash_nested on;
}
# Video on Demand
application vod {
play /home/vod;
}
# Restream
application restream {
live on;
# push server1:1935
# push server2:1935
}
}
}
@theraw

This comment has been minimized.

Copy link

commented Nov 17, 2017

chunk size: 8192; => chunk_size 8192;

@pitdeer

This comment has been minimized.

Copy link

commented Nov 21, 2017

You missed a semicolon in the end of line 17

@zikoops

This comment has been minimized.

Copy link

commented Dec 5, 2017

edit chunk size: 8192; => chunk size 8192;

@ulyssesr

This comment has been minimized.

Copy link
Owner Author

commented Jul 14, 2018

Corrected. Thank you.

@rchadgray

This comment has been minimized.

Copy link

commented Aug 28, 2018

Still missing the underscore on
chunk size

Should be chunk_size

I have this running and i can view my stream with VLC, but i get a 404 can't find the url to the index.m3u8 file if i try to use the HTML5 video tag to display it. Any idea what i am missing?

<video width="352" height="288" src="http://10.1.0.100/live/index.m3u8" controls autoplay>

@rchadgray

This comment has been minimized.

Copy link

commented Aug 29, 2018

Line 23 and 27 I believe the alias's should not have live on the end.

alias /home/hls/live;
alias /home/dash/live;

@Yamiraan5

This comment has been minimized.

Copy link

commented Jan 30, 2019

Hey ulyssesr how to contact you for a paid job, Thanks
My email is yamiraan@gmail.com

@Sub-7

This comment has been minimized.

Copy link

commented Feb 16, 2019

!!! unknown directive "chunk" in /etc/nginx/nginx.conf
LINE 37: chunk size 8192; to => chunk_size 8192;
Bljad, that's just a sign!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.