VLC can't play back when I try to connect it to the Ngix / HLS port in Windows 10
Posted
#382
(In Topic #79)
Standard member
I'm trying to do HLS streaming with NGINX + OBS on WIndows 10 following this video tutorial on youtube :
I don't know what's wrong with the configuration ,but VLC can't connect to localhost:8080 when I want to play back the streaming. Here I want to synthesize what I'm sure that it is working now :
1) the *.ts and the m3u8 files are produced inside the folder /nginx/hls
2) on the OBS stream panel I have configured the server with : rtmp://192.168.1.6:1935/live/ ; stream key = 1234
3) again in OBS I have included a media source with input : rtmp://192.168.1.6:1935/live/ and input format = rtmp
4) the rtmp server part inside the nginx file is something like this :
rtmp {
server {
listen 1935;
chunk_size 4000;
application live {
live on;
hls on;
hls_path /nginx/hls/;
hls_fragment 3;
#hls_playlist_lenght 60;
deny play all;
}
}
}
5) the web server part inside the nginx file is something like this :
server {
listen 8080;
server_name localhost;
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root nginx-rtmp-module/;
}
location /control {
rtmp_control all;
}
6) on VLC I try to open this URL : 92.168.1.6:8080/hls/1234.m3u8 , but it says that it can't connect to this URL.
So,what's wrong ? I have attached also some screenshots that u can find here : https://drive.google.com/open?id=1muULgzfrBir2Xk6oeHHIIDXjsWKyPVdF , where u can find also my nginx.conf file.
Last edit: by ziomario
Posted
NOTS Staff
ziomario said
in OBS I have included a media source with input : rtmp://192.168.1.6:1935/live/ and input format = rtmp
From “VLC can't play back when I try to connect it to the Ngix / HLS port in Windows 10”, March 16th 2020, 10:36 AM
Why did you add a media source in OBS? My tutorial did not say anything about adding your stream back in as a media source, and it makes no sense at all to do that.
Your locations specified in NGINX point to /stat, /stat.xsl, and /control, while your RTMP server is not pointing to any of those. It seems like you don't understand the concept behind what you're trying to do here. The RTMP server is going to create files, and you need the HTTP server to serve those files. There's no point trying to play your stream back in VLC until your web browser is able to access the .m3u8 file. Also, you should stop using "localhost" and your IP address interchangeably, because you're confusing things even more when you do that.
Why did you specify "server_name localhost;" in your NGINX configuration? That line is telling NGINX to only serve requests using the "localhost" name and not anything else (such as an IP address.) It's doing exactly what you told it to do.
Posted
Standard member
1 guest and 0 members have just viewed this.