I have installed and started the Nginx server on Ubuntu 14.04. My objective is to stream a video (live) using HLS (HTTP live streaming). I followed this tutorial https://www.vultr.com/docs/setup-nginx-on-ubuntu-to-stream-live-hls-video , and it recommends using OBS-STUDIO. However, I don't know how to stream from the OBS-STUDIO to the Nginx and then view the stream from other machines (eg with VLC).
URL: rtmp://domain_name:1935/hlslive stream name: test
vim /usr/local/nginx/conf/nginx.conf
add or config the following module:
rtmp {
server {
listen 1935; #listen port
chunk_size 4096;
application hlslive { #rtmp push stream request path
live on;
hls on;
hls_path /usr/share/nginx/html/hlslive/test;
hls_fragment 3s;
hls_playlist_length 18s;
}
}
}
also config as a http server for hls m3u8 request:
http {
...
server {
listen 8080;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
run nginx
nginx -c /usr/local/nginx/conf/nginx.conf
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.