-
Notifications
You must be signed in to change notification settings - Fork 7
/
VideoCheckerFlow
1 lines (1 loc) · 5.77 KB
/
VideoCheckerFlow
1
[{"id":"e81402f5.f8254","type":"tab","label":"Video Checker","disabled":false,"info":"this flow check the video service and parse the array containing videos.\nIf any is present will create a video end point into FTS"},{"id":"251def67.cd2e7","type":"inject","z":"e81402f5.f8254","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":200,"wires":[["f0d3fb39.18e618"]]},{"id":"f0d3fb39.18e618","type":"http request","z":"e81402f5.f8254","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://64.227.70.49:9998/metrics","tls":"","persist":false,"proxy":"","authType":"","x":310,"y":160,"wires":[["c22cd664.3540e8"]]},{"id":"be1ce8b6.793658","type":"debug","z":"e81402f5.f8254","name":"RTSP!","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":240,"wires":[]},{"id":"c22cd664.3540e8","type":"split","z":"e81402f5.f8254","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":310,"y":360,"wires":[["f3a8bf19.1f6e7","9345062e.bb7738"]]},{"id":"2a7e77e7.a92748","type":"http request","z":"e81402f5.f8254","name":"Post Video to FTS","method":"POST","ret":"txt","paytoqs":"ignore","url":"{{{addr}}}:{{{port}}}/ManageVideoStream/postVideoStream","tls":"","persist":false,"proxy":"","authType":"bearer","x":1130,"y":240,"wires":[["25874402.182cec","f8da2c2e.b2fb3"]]},{"id":"25874402.182cec","type":"switch","z":"e81402f5.f8254","name":"check retunr","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"str"},{"t":"eq","v":"500","vt":"str"},{"t":"eq","v":"401","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1340,"y":240,"wires":[["791450ee.61b5a"],["1b6de090.e2467f"],["a48bd58e.401dc8"]]},{"id":"791450ee.61b5a","type":"debug","z":"e81402f5.f8254","name":"Success!","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1520,"y":200,"wires":[]},{"id":"1b6de090.e2467f","type":"debug","z":"e81402f5.f8254","name":" INTERNAL SERVER ERROR","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1640,"y":240,"wires":[]},{"id":"a48bd58e.401dc8","type":"debug","z":"e81402f5.f8254","name":"Non authorized","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1560,"y":300,"wires":[]},{"id":"41b82d8d.8266e4","type":"function","z":"e81402f5.f8254","name":"CreateVideoStream","func":"\n msg.addr = global.get('FTH_FTS_URL');\n msg.port = global.get('FTH_FTS_API_Port');\n msg.streamPort = global.get('FTH_FTS_STREAM_Port');\n msg.streamAddress = global.get('FTH_FTS_VIDEO_URL');\n let streamPath = msg.payload;\n let alias = streamPath;\n let streamProtocol= \"rtsp\";\n\n \n\nmsg.payload = [];\n\n msg.payload={\n alias: alias,\n streamProtocol: streamProtocol,\n streamAddress: msg.streamAddress,\n streamPort: msg.streamPort ,\n streamPath: streamPath,\n };\n \nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1190,"y":600,"wires":[["2a7e77e7.a92748","351711f.8aa5aee"]]},{"id":"f3a8bf19.1f6e7","type":"switch","z":"e81402f5.f8254","name":"Video content","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"rtsp_paths","vt":"str"},{"t":"cont","v":"rtsp_clients{state=\"reading\"}","vt":"str"},{"t":"cont","v":"rtsp_sources{type=\"rtsp\",state=\"idle\"}","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":480,"y":540,"wires":[["9ee6985e.78a718"],["25201dd3.dc0212"],[],["3410cfed.0a451"]]},{"id":"3410cfed.0a451","type":"debug","z":"e81402f5.f8254","name":"Other!","active":true,"tosidebar":false,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":740,"wires":[]},{"id":"9345062e.bb7738","type":"debug","z":"e81402f5.f8254","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":450,"y":260,"wires":[]},{"id":"25201dd3.dc0212","type":"debug","z":"e81402f5.f8254","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"readoing!","targetType":"msg","statusVal":"","statusType":"auto","x":700,"y":620,"wires":[]},{"id":"85d13fc4.0e0e8","type":"inject","z":"e81402f5.f8254","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"rtsp_paths[live/corvoVideo]","payloadType":"str","x":110,"y":360,"wires":[["c22cd664.3540e8"]]},{"id":"9ee6985e.78a718","type":"function","z":"e81402f5.f8254","name":"Separate path","func":"let m = msg.payload.replace(\"rtsp_paths[\", \"\").replace(\"]\",\"\");\nmsg.payload = m;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":400,"wires":[["be1ce8b6.793658","496f49ed.9ded78"]]},{"id":"351711f.8aa5aee","type":"debug","z":"e81402f5.f8254","name":"Rest Payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1330,"y":680,"wires":[]},{"id":"f8da2c2e.b2fb3","type":"debug","z":"e81402f5.f8254","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1300,"y":340,"wires":[]},{"id":"496f49ed.9ded78","type":"rbe","z":"e81402f5.f8254","name":"monitor new streams","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":970,"y":520,"wires":[["41b82d8d.8266e4"]]}]