what is behind showPtzControls ? Your addition to the original tileboard code or I simply missed this ? would you be so nice and share it how did you do that ?
did you have to change anything in the code in order to get HQ in popup ? pls see my previous message … just above yours
Oh sorry, yes, showPTzControls is a custom extension. It works like the door entry tile. Just a convenience flag to add a set of PTZ controls to the camera popup. In fact you could just use the door entry tile for this, the layout is configurable.
To get two different cameras on the static tile and the popup, an easy way to get this without too many modifications is to change the way the popup acquires the camera entity ids. In index.html (line 80 onwards), getItemEntity is called to get the cameras and make them selectively visible. You can replace this call (see main.js) to grab a different camera instead, maybe just by removing the _lowres postfix on the entity name. Something like:
thx for response …
actually I’m using door entry tile as I added some buttons to move camera to predefined position, open gates etc
Anyway … I’m still having problem with showing high quality streams in tileboard … they are ok in HA lovelance but not showing up in tileboard
so again question … have you change anything in order to make it work or this is just my local issue ?
just for reference i tried different combinations of:
platforms generic, ffmpeg, proxy
rtsp urls:
a) rtsp://user:pass@MyCamIP/ISAPI/Streaming/channels/101
b) rtsp://user:pass@MyCamIP/Streaming/Channels/101
c) rtsp://user:pass@MyCamIP/Streaming/Channels/102
non of those combinations worked for me in tileboard
only platform synology works for me in both: HA lovelace and tileboard
No, I didn’t change anything in the actual streaming code. The stream processing is done differently in Lovelace vs Tileboard. Alexey uses HLS.js for stream processing and rendering, which is a third party HLS client library. It’s a pretty complex piece of code, but it seems to be quite advanced. There are lots of options you can tweak. But except for the cache size (which just changes the steam latency), I didn’t change anything.
You need to make sure to use a h264 stream on the primary stream of your camera. h265 does not work (yet ?). This is my config:
The secondary stream is not used in my case, as I use a proxy to downscale. You can then access this using the RTSP URL. Try it with VLC first to see if it works and if it outputs a h264 stream. You should use the generic camera platform with stream_source, the ffmpeg platform is obsolete.
Two little things: you can remove the ‘entity’ under ‘fullscreen’, that was a custom modification in my code. It would obviously be nice if that would be supported by TileBoard directly
And for the refresh, you should use the anonymous function that returns a slightly randomized value rather than a fixed one. Otherwise you might run into problems where your browser caches the result without updating it.
OMG … I’m blind
in fullscreen: section I’ve used TYPES.CAMERA instead of TYPES.CAMERA_STREAM
inexplicably it was ok for synology stream
Now all seems to be ok with generic hq stream … thank you
Yes that’s normal. But you can do something about it.
There are two sources of delay. First is the HA stream component, which will take the camera h264 stream and convert it to hls. Because there is no reencoding done (would take too much CPU on platforms like the pi), the hls segments are always cut on an I frame. So the only way to reduce latency on that component is to add more I frames into the stream. That will increase the required bandwidth. Not all cameras support this. Hikvisions usually do (see the config shot I posted above). I’m using an iframe every 20 frames, with a framerate of 10 frame per second. That means that each hls segment can be around 2 seconds long.
Second source of latency (which adds to the first) is hls.js used in Tileboard. What this code does is basically consume the hls segments produced by HA, restitch them together and display them as video on the client. Hls has a buffer. By default it’s 30 seconds, which is HUGE. You can make it smaller to reduce latency.
Open directives.js, go to where it defines the cameraStream directive and replace this code:
var hls = new Hls();
By this:
var config = {
maxBufferLength: 5,
maxMaxBufferLength: 5,
};
var hls = new Hls(config);
You can experiment with different buffer sizes. Don’t make them too small, or your stream won’t play back smoothly anymore if your internet connection isn’t perfectly stable (like for example a 4G connection).
so i’ve been looking around the code and i was able to put the light sliders in a different pop-up window, everything is fine until i try to change the value, i get “property ‘id’ of undefined”, the problem is here
I have a strange situation with the TYPES.CAMERA_STREAM mode. It works fine on Android devices, but not on iOS devices. Why is this happening, does anyone have such a problem?
Is it possible to create an icon in the sidebar (just like we do for pages) but that runs a function when pressed instead of flipping to a page?
I’d like to add a “reload”/“refresh” button in the page icon bar. I know we can do this with a tile on the page but I would like to save actual page real estate for other items.
Also, does anyone know of any tutorials on how to creat new/custom tiles?
Nice find. I really didn’t have any time to look into the library when I implemented HLS streaming. Would you like to create a PR for that? Including optional entity_id for fullscreen looks like a good idea as well.
Perhaps we could make it possible to override HLS config from the definition of tile just like we do for charts.
You can add a tile with negative position (see bottom left corner). But I do not know how to get it on top of z-stack. Pages menu overlapping it, and not allow to click.
So I’ve done with reload icon in the header (see top right corner).
Header icon example:
Edit: OK, done. I added the possibility to specify a different camera entity for the popup view, as well as to configure the HLS buffer size. I did not expose the entire hlsjs config object. I think that would be overkill. The hls.js options are extremely specific, mostly around stream QoS, sync, subtitles, audio. So all very important when you write a VOD client, but not very useful for what we do here. It could still be added if needed, of course.
Would you be so kind and share with us your PZT urls ?
I know how to call one of preset positions (/ISAPI/PTZCtrl/channels/1/presets/1/goto) but don’t know how to pan up,down fill left,right and zoom + -