Hi folks,
Long time between my announcements. But let's be honest: it would be a lousy Christmas without presents under the Node-RED community tree...
The last version of my node-red-contrib-multipart-stream-decoder node was already more than 4 years old. Meanwhile I had quite a lot of questions to implement digest authentication (a.o. from @dynamicdave), because nowadays most IP camera's require it when you want to read an MJPEG stream.
Since my new Amcrest camera's also use digest authentication, I had no other choice than to implement it. And here it is finally in version 1.0.0
Must admit that it was not easy to get it done, because it seems that only the "request" lib offered pause and resume functionality. But the other libraries ("got", "axios", "node-fetch") not... Tried them all, but at the end I have sticked to axios, and I workaround it.
Short demo to get in to the christmas mood
Although I have to admit that at this moment of the evening, it is pretty dark and there is not much movement in the Christmas markets as you can see
[{"id":"50a4d182a71cdf80","type":"inject","z":"fbee74db83781e91","name":"Stop stream","props":[{"p":"stop","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","x":530,"y":3240,"wires":[["8c35709.24b749"]]},{"id":"731c40362af5e27a","type":"inject","z":"fbee74db83781e91","name":"Pause stream","props":[{"p":"pause","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","x":530,"y":3140,"wires":[["8c35709.24b749"]]},{"id":"382a1962b0da9b0d","type":"inject","z":"fbee74db83781e91","name":"Resume stream","props":[{"p":"resume","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","x":520,"y":3200,"wires":[["8c35709.24b749"]]},{"id":"ee86d795.1e8cb8","type":"inject","z":"fbee74db83781e91","name":"First stream (Czech Republic)","props":[{"p":"url","v":"http://89.203.137.209/mjpg/video.mjpg","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","x":440,"y":3040,"wires":[["8c35709.24b749"]]},{"id":"8c35709.24b749","type":"multipart-decoder","z":"fbee74db83781e91","name":"","ret":"bin","url":"","tls":"","authentication":"digest","delay":0,"maximum":"1000000","blockSize":"1","enableLog":"on","credentials":{},"x":750,"y":3040,"wires":[["a47f8c9bfe0c0793"],[]]},{"id":"a47f8c9bfe0c0793","type":"image","z":"fbee74db83781e91","name":"","width":"400","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":980,"y":3040,"wires":[]},{"id":"c6cf7a07de508770","type":"inject","z":"fbee74db83781e91","name":"Second stream (Marktplatz Austria)","props":[{"p":"url","v":"http://cam1.rauris.net/axis-cgi/mjpg/video.cgi","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":460,"y":3080,"wires":[["8c35709.24b749"]]}]
P.S. At the moment of this announcement, it seems the streams get mixed up when you switch too fast between different streams. I didn't analyze that yet...
As always, it would be nice if some folks could test it. Since it is not on NPM yet, you can install it from my Github account using following command (from within your .node-red folder):
npm install bartbutenaers/node-red-contrib-multipart-stream-decoder
Enjoy it!!!
Bart