Categories
IT Streaming Uncategorized

Additional Thoughts About HLS Streaming

It seems that in these days of social distancing, many people want to find ways of streaming all sorts of RTMP feeds to all sorts of places.

The company F5 who makes NGINX has put out a video tutorial showing some examples of using NGINX to convert RTMP input into HLS and DASH video that can be played. F5 has a tutorial for the open source version of NGINX and the commercial version called NGINX Plus.

I’m mainly interested in the open source one right now, but they’ve said they can offer a one year Plus license for free right now to people in a few non-profit groups. That’s neat and I’ll look into that further later.

The post from NGINX and the video tutorials to learn a little more about HLS and DASH streaming is seen at: https://www.nginx.com/blog/video-streaming-for-remote-learning-with-nginx/#For-More-Advanced-Needs

I’ve tried this and I’m doing something wrong in it. I think I made a mistake somewhere, Nginx won’t run after modifying the .conf file. There might be an issue with how the video portrays creating a working directory and then the written tutorial does. When I tried to remedy that, I sort of lost where each portion of the Nginx program was located.

Categories
Computers IT Networking Streaming

Statistics and Webpage for the HLS server

I need a few statistics for the HLS server because as you stream the .m3u8 file, it’s a bit hard to tell how many people are using the app to watch it. I’ve inserted a couple statistics pages on this server to help get a better pictures of who’s using it.

The first way is to use the RTMP streaming statistics as seen in the /etc/nginx/sites-available/default file at the location at the bottom.

## XML stylesheet to view RTMP stats. Copy stat.xsl wherever you want and put the full directory path here
location /stat.xsl {
	root /var/www/html/;
	}
## This provides RTMP statistics in XML at 
location /stat {
	rtmp_stat all;
	rtmp_stat_stylesheet stat.xsl;
	}

This outputs a nice little page that looks like below:

The next bit of Stats that I added was the below. This is from the stub_status output. It’s very simple and only somewhat useful, but it’s a start on seeing how many people are on my .m3u8 feed. The active connections is the useful part however because of the internal connections and my own viewing of this page, out of the 11 seen connections I think only about 3 or so are actually users on our app in the below case.

I put in a little index.html file to replace the original that tells you Nginx on a standard install of Nginx. I made my page just give a few links to the various status reports on the server. It makes it a little bit easier to use and will help when I train others to use these servers later. The status page looks like the below:

This is made with an index.html file with the links to the low resolution, high resolution HLS feeds as well as the two status pages.

  • Connection link: https://your_domain_name_here.xyz/nginx_status
  • RTMP feed status: https://your_domain_name_here.xyz/stat.html
  • Low Res link: https://your_domain_name_here.xyz/low.html
  • High Res link: https://your_domain_name_here.xyz/live.html

I’m still trying to find more ways to get better statistics out of the HLS feed use, however I haven’t gotten there yet. I’ll probably keep this updated to tell others when I find more ways to do it.