How to: Embed h264 live stream from Blue Iris on your website.

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,680
Reaction score
14,041
Location
USA
This method uses HTTP Live Streaming (HLS), which I have found to be stable and reliable in recent versions of Blue Iris. Here is the trick: Most web browsers do not support HLS natively. For the stream to work in most browsers, you will need to use a 3rd party player such as Clappr which is free and extremely easy to use!

Here in this Spoiler block is a basic example of a web page which embeds a live video stream using the Clappr player. You can create a new file named livestream.htm in your Blue Iris's www directory, and paste in the following to try it now.

HTML:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Live Video</title>
	<script type="text/javascript" src="https://cdn.jsdelivr.net/clappr/latest/clappr.min.js"></script>
</head>
<body>
	<div id="player"></div>
	<script type="text/javascript">
		var player = new Clappr.Player(
		{
			source: "/h264/index/temp.m3u8"
			, parentId: "#player"
			, autoPlay: true
			, width: 1280
			, height: 720
		});
	</script>
</body>
</html>

Hints/Tips:
  • If you don't want to stream the entire All Cameras group, change the word "index" in the example above to one of your other group names, or a camera short name.
  • If you are going to embed the video player on a website not hosted by Blue Iris, you will need to change the video source URL to an absolute URL (include the http://hostname[B]:[/B]port/) and also you will need to have disabled authentication for all incoming connections in Blue Iris.
  • You can change many aspects of the player by adding more arguments. This example only shows you the autoPlay, width, and height arguments, but the Clappr homepage has a more complete list.
  • Some cameras with an embedded audio stream won't play for me, while other cameras will. I have not determined the cause for this, but if you have this problem you can probably work around it by making a clone of the camera in BI with the audio stream disabled for the clone.
  • The video stream appears to always use the Streaming 0 encoder profile that you can set up in Blue Iris Options > Web server.
  • Streaming to multiple viewers simultaneously does not seem to use much more CPU than streaming to only a single viewer.
  • It takes several seconds for Blue Iris to begin streaming, if nobody else was already watching.
  • There is about 10 to 15 seconds of delay from live. This is normal and there really isn't much you can do to reduce it.
  • The frame rate may be low if you are streaming from a very high resolution camera. I suggest you configure the Streaming 0 encoder profile to limit the frame size to 1920x1080 or smaller.
  • Using this method, you should be able to stream much more efficiently than previous JPEG or MJPEG-based methods.
 

wcrowder

Getting the hang of it
Joined
Oct 8, 2015
Messages
294
Reaction score
53
Location
French Lick, Indiana 47432
I was looking at what you posted. Experimenting with MSE and Dash.all.js and stumbled onto this. With the newest MS "Edge" browser you can simply type in "http://192.168.1.xx:xx/h264/cam1/temp.m3u8" and "whala", your streaming the index, cameras anything directly.

This trick only seems to work with windows 10 build latest build's "Edge" browser.

Out of time tonight, but I think this could be implemented with W3C HTML5 MSE extensions. I wonder if we could get the developer to add a manifest.mpd with along with .m3u8 to the mix? LOL.


It works, but the delay makes it untenable.
 
Last edited by a moderator:

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,680
Reaction score
14,041
Location
USA
Yes, the long delay makes it bad for realtime monitoring (like to see who is at the door) but not unusable for a tourist-attraction kind of thing or when you are away from home so it doesn't really matter if what you see is 10 seconds late or not.

I wonder of DASH does latency any better than HLS. I think both work on the principle of creating consecutive seconds-long video files, so it is probably just as bad and would not be worth his time to implement.

The ActiveX plugin manages to do it with almost no latency. I'm sure Ken could pull off something with similarly low delay if he taught his web server to speak WebSocket (necessary to stream chunks of data via a single connection without a plugin) and wrote his own MSE extension to teach the browser how to play the video.
 
Last edited:

wcrowder

Getting the hang of it
Joined
Oct 8, 2015
Messages
294
Reaction score
53
Location
French Lick, Indiana 47432
Yes, the long delay makes it bad for realtime monitoring (like to see who is at the door) but not unusable for a tourist-attraction kind of thing or when you are away from home so it doesn't really matter if what you see is 10 seconds late or not.

I wonder of DASH does latency any better than HLS. I think both work on the principle of creating consecutive seconds-long video files, so it is probably just as bad and would not be worth his time to implement.

The ActiveX plugin manages to do it with almost no latency. I'm sure Ken could pull off something with similarly low delay if he taught his web server to speak WebSocket (necessary to stream chunks of data via a single connection without a plugin) and wrote his own MSE extension to teach the browser how to play the video.
From what I'm reading, it looks like MSE is getting included into HTML5 via W3c. Works real well with static video. Dash is just a player, like clappr, I can see different implementations of it. It appears to me that the ones that work real-time, want licensing fees for the authors to implement on there servers. That's not very open standard...

I think the latency is worse... Probably don't have it right...
 
Last edited by a moderator:

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,680
Reaction score
14,041
Location
USA
Ah, I thought you meant MPEG-DASH.

At best, you can get latency to about 4 or 5 seconds in the Clappr player by making it seek to the very edge of what is has buffered. Beyond that would be impossible because Blue Iris hasn't sent you the file yet which contains that video.

True very low latency streaming will pretty much have to be a custom implementation at this point.
 
Top