Try this. Amazing!! The cpu load on the RPi3 is just 2-5% full streaming, resolution is 1280x720
What I have seen earlier with other implementations is that streaming rtsp normally loads the cpu pretty heavy. What is the magic with this solution??
[{"id":"17b65c21.7ccc04","type":"inject","z":"252b9369.44a80c","name":"Start stream","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"true","payloadType":"bool","x":200,"y":2110,"wires":[["f5b5c38a.da9e1"]]},{"id":"276bae27.561f22","type":"inject","z":"252b9369.44a80c","name":"Stop stream","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":200,"y":2156,"wires":[["f5b5c38a.da9e1"]]},{"id":"f5b5c38a.da9e1","type":"switch","z":"252b9369.44a80c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":351,"y":2110,"wires":[["ff51760d.697c18"],["c50afbe.1105d08"]]},{"id":"c50afbe.1105d08","type":"function","z":"252b9369.44a80c","name":"stop","func":"msg = {\n kill:'SIGHUP',\n payload : 'SIGHUP' \n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":371,"y":2159,"wires":[["ff51760d.697c18"]]},{"id":"ff51760d.697c18","type":"exec","z":"252b9369.44a80c","command":"ffmpeg -loglevel quiet -rtsp_transport tcp -i rtsp://freja.hiof.no:1935/rtplive/_definst_/hessdalen03.stream -an -c:v copy -f mp4 -movflags +frag_keyframe+empty_moov+default_base_moof pipe:1","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"Camera in Norway","x":570,"y":2130,"wires":[["2ae7c8d7.f9d5d8","e2faba94.e42518"],[],["2ae7c8d7.f9d5d8"]]},{"id":"be24c09a.8c9c6","type":"ui_mp4frag","z":"252b9369.44a80c","name":"Camera in Norway ui_mp4frag","group":"4246a880.b5ddb8","order":0,"width":"10","height":"6","readyPoster":"https://raw.githubusercontent.com/kevinGodell/node-red-contrib-ui-mp4frag/master/video_playback_ready.png","errorPoster":"https://raw.githubusercontent.com/kevinGodell/node-red-contrib-ui-mp4frag/master/video_playback_error.png","hlsJsConfig":"{\"liveDurationInfinity\":true,\"liveBackBufferLength\":0,\"maxBufferLength\":5,\"manifestLoadingTimeOut\":1000,\"manifestLoadingMaxRetry\":10,\"manifestLoadingRetryDelay\":500}","restart":"true","autoplay":"true","x":1130,"y":2130,"wires":[[]]},{"id":"2ae7c8d7.f9d5d8","type":"mp4frag","z":"252b9369.44a80c","name":"Camera in Norway mp4frag","hlsPlaylistSize":"10","hlsPlaylistExtra":"5","hlsPlaylistUrl":"norway","x":850,"y":2130,"wires":[["be24c09a.8c9c6"]]},{"id":"e2faba94.e42518","type":"msg-speed","z":"252b9369.44a80c","name":"","frequency":"sec","estimation":true,"ignore":false,"x":800,"y":2190,"wires":[[],[]]},{"id":"4246a880.b5ddb8","type":"ui_group","z":"","name":"Video Test 1","tab":"e338d88b.0fb2b8","order":15,"disp":true,"width":"15","collapse":true},{"id":"e338d88b.0fb2b8","type":"ui_tab","z":"","name":"Video Test 1","icon":"dashboard","disabled":false,"hidden":false}]