-
Notifications
You must be signed in to change notification settings - Fork 0
/
RTSP to Dashboard and timeshift video
6 lines (3 loc) · 9.38 KB
/
RTSP to Dashboard and timeshift video
1
2
3
4
5
6
[{"id":"4bb882e4.70a7ac","type":"exec","z":"3e258eaf.c16532","command":"ffmpeg -rtsp_transport tcp -i rtsp://your.camera.ip.address:your_port/stream_url -y -s 1280x720 -vframes:v 1 static/latestimage.jpg -s 1280x720 -vframes:v 1 -strftime 1 'static/shift/image_%Y-%m-%d___%H-%M-%S.jpg'","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Grab picture using exec command","x":540,"y":140,"wires":[["26eb4b0b.491564"],[],[]]},{"id":"384e156a.00005a","type":"inject","z":"3e258eaf.c16532","name":"Grap IP Cam photo every 10 second","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":140,"wires":[[]]},{"id":"73fa2400.a51acc","type":"function","z":"3e258eaf.c16532","name":"Create ffmpeg d","func":"function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n}\nvar tempString =formatDate(Date().toString());\n\nvar tempString1 = \"ffmpeg -y -r 1/0.1 -pattern_type glob -i 'static/shift/image_\";\nvar tempString2 = tempString1.concat(tempString);\nvar tempString3 = tempString2.concat(\"*.jpg' -strftime 1 '/media/pi/USBDRIVE/hjemmeflow/Shift_\");\nvar tempString4 = tempString3.concat(tempString);\nvar finalPath = tempString4.concat(\".mp4'\");\nmsg.filename=finalPath;\n\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":340,"wires":[["18d23b51.bc6075"]]},{"id":"7f35699.8691098","type":"inject","z":"3e258eaf.c16532","name":"","topic":"Manual Start","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":400,"wires":[["73fa2400.a51acc"]]},{"id":"cec60d75.cfc5c","type":"debug","z":"3e258eaf.c16532","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1130,"y":340,"wires":[]},{"id":"d433683a.387b88","type":"exec","z":"3e258eaf.c16532","command":"","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":950,"y":340,"wires":[[],[],[]]},{"id":"d72e979b.e0d098","type":"change","z":"3e258eaf.c16532","name":"","rules":[{"t":"move","p":"filename","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":340,"wires":[["cec60d75.cfc5c","d433683a.387b88"]]},{"id":"54c982b0.542fdc","type":"bigtimer","z":"3e258eaf.c16532","outtopic":"","outpayload1":"go","outpayload2":"","name":"Automate","comment":"","lat":"52.520008","lon":"13.404954","starttime":"1425","endtime":"0","starttime2":"0","endtime2":"0","startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"repeat":false,"atstart":false,"odd":false,"even":false,"x":120,"y":340,"wires":[["73fa2400.a51acc","f8fe11bd.2ad26"],[],[]]},{"id":"b564ddcc.ea671","type":"base64","z":"3e258eaf.c16532","name":"Convert to base64","action":"str","property":"payload","x":1050,"y":140,"wires":[["f1120487.371448"]]},{"id":"f1120487.371448","type":"template","z":"3e258eaf.c16532","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<img width=\"640px\" src=\"data:image/jpg;base64,{{{payload}}}\">","output":"str","x":1220,"y":140,"wires":[["52c11e2e.1d09a"]]},{"id":"52c11e2e.1d09a","type":"ui_template","z":"3e258eaf.c16532","group":"b57f0f14.4e1b7","name":"Latest image","order":0,"width":"12","height":"8","format":"<a href=\"/latestiamge.jpg\" target=\"_black\"><div ng-bind-html=\"msg.payload\"></div></a>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1370,"y":140,"wires":[[]]},{"id":"26eb4b0b.491564","type":"file in","z":"3e258eaf.c16532","name":"Save to latestimage.jpg","filename":"static/latestimage.jpg","format":"","chunk":false,"sendError":false,"encoding":"base64","x":830,"y":140,"wires":[["b564ddcc.ea671"]]},{"id":"b5752d83.09104","type":"comment","z":"3e258eaf.c16532","name":"FFMpeg - Open IPCam stream and save image to Timeshift location and Latest for dashboard AND Refresh dashboard image","info":"","x":480,"y":80,"wires":[]},{"id":"dc7f929f.e6fc5","type":"comment","z":"3e258eaf.c16532","name":"FFMpeg - Create a slideshow video of all the images from the day - Activate before midnight and execute during night","info":"","x":450,"y":280,"wires":[]},{"id":"f8fe11bd.2ad26","type":"function","z":"3e258eaf.c16532","name":"Delete files after video creation","func":"function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n}\nvar tempString =formatDate(Date().toString());\n\nvar tempString1 = \"sudo rm /home/pi/static/shift/*\";\nvar tempString2 = tempString1.concat(tempString);\nvar finalPath = tempString2.concat(\"*.*\");\nmsg.filename=finalPath;\n\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":400,"wires":[["523f5661.ce1078"]]},{"id":"9439d27.a59f43","type":"change","z":"3e258eaf.c16532","name":"","rules":[{"t":"move","p":"filename","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":400,"wires":[["6becdde7.7f6fe4"]]},{"id":"6becdde7.7f6fe4","type":"debug","z":"3e258eaf.c16532","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1130,"y":400,"wires":[]},{"id":"523f5661.ce1078","type":"delay","z":"3e258eaf.c16532","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"hours","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":660,"y":400,"wires":[["9439d27.a59f43"]]},{"id":"18d23b51.bc6075","type":"delay","z":"3e258eaf.c16532","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"hours","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":580,"y":340,"wires":[["d72e979b.e0d098"]]},{"id":"b57f0f14.4e1b7","type":"ui_group","z":"","name":"Main","tab":"2eff634c.1c4f7c","order":2,"disp":true,"width":"12","collapse":false},{"id":"2eff634c.1c4f7c","type":"ui_tab","z":"","name":"IP Camera","icon":"dashboard","order":3,"disabled":false,"hidden":false}]
[{"id":"4bb882e4.70a7ac","type":"exec","z":"3e258eaf.c16532","command":"ffmpeg -rtsp_transport tcp -i rtsp://176.23.129.200:554/stream1 -y -s 1280x720 -vframes:v 1 static/latestimage.jpg -s 1280x720 -vframes:v 1 -strftime 1 'static/shift/image_%Y-%m-%d___%H-%M-%S.jpg'","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Grab picture using exec command","x":540,"y":120,"wires":[["26eb4b0b.491564"],[],[]]},{"id":"384e156a.00005a","type":"inject","z":"3e258eaf.c16532","name":"Grap IP Cam photo every 10 second","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":120,"wires":[[]]},{"id":"b564ddcc.ea671","type":"base64","z":"3e258eaf.c16532","name":"Convert to base64","action":"str","property":"payload","x":1050,"y":120,"wires":[["f1120487.371448"]]},{"id":"f1120487.371448","type":"template","z":"3e258eaf.c16532","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<img width=\"640px\" src=\"data:image/jpg;base64,{{{payload}}}\">","output":"str","x":1220,"y":120,"wires":[["52c11e2e.1d09a"]]},{"id":"52c11e2e.1d09a","type":"ui_template","z":"3e258eaf.c16532","group":"b57f0f14.4e1b7","name":"Latest image","order":0,"width":"12","height":"8","format":"<a href=\"/latestiamge.jpg\" target=\"_black\"><div ng-bind-html=\"msg.payload\"></div></a>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1370,"y":120,"wires":[[]]},{"id":"26eb4b0b.491564","type":"file in","z":"3e258eaf.c16532","name":"Save to latestimage.jpg","filename":"static/latestimage.jpg","format":"","chunk":false,"sendError":false,"encoding":"base64","x":830,"y":120,"wires":[["b564ddcc.ea671"]]},{"id":"b5752d83.09104","type":"comment","z":"3e258eaf.c16532","name":"FFMpeg - Open IPCam stream and save image to Timeshift location and Latest for dashboard AND Refresh dashboard image","info":"","x":480,"y":60,"wires":[]},{"id":"b57f0f14.4e1b7","type":"ui_group","z":"","name":"Main","tab":"2eff634c.1c4f7c","order":2,"disp":true,"width":"12","collapse":false},{"id":"2eff634c.1c4f7c","type":"ui_tab","z":"","name":"IP Camera","icon":"dashboard","order":3,"disabled":false,"hidden":false}]
https://pasteboard.co/J5IOlGh.png