Oh yes, sorry
Some words about it, you need to install some nodes you might miss
- node-red-contrib-multipart-stream-decoder
- node-red-contrib-image-output
In the flow exec node configurations you can see I use uxterm as terminal in my RPi. You can use the standard lxterminal instead
I did put the Python script into my /home/pi folder
If the examples doesn't work straight away it could be you need to double-check the size of your images from the camera and then adjust the params accordingly
Best regards, Walter
[
{
"id": "ecc6c6fb8c950e4f",
"type": "inject",
"z": "aea09193ec9a7e2a",
"name": "Stop stream",
"props": [
{
"p": "stop",
"v": "true",
"vt": "bool"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"topic": "",
"x": 130,
"y": 110,
"wires": [
[
"098062df0900fe5e"
]
]
},
{
"id": "098062df0900fe5e",
"type": "multipart-decoder",
"z": "aea09193ec9a7e2a",
"name": "",
"ret": "bin",
"url": "",
"tls": "",
"authentication": "none",
"delay": 0,
"maximum": "1700000",
"blockSize": "1",
"enableLog": "off",
"x": 370,
"y": 60,
"wires": [
[
"efc5178ac411e16a"
],
[]
]
},
{
"id": "7243d4f8d03405de",
"type": "inject",
"z": "aea09193ec9a7e2a",
"name": "Working stream 1",
"props": [
{
"p": "url",
"v": "http://cam1.rauris.net/axis-cgi/mjpg/video.cgi",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 140,
"y": 60,
"wires": [
[
"098062df0900fe5e"
]
]
},
{
"id": "efc5178ac411e16a",
"type": "mqtt out",
"z": "aea09193ec9a7e2a",
"name": "",
"topic": "videoclip_test1",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "d25677b9.097f68",
"x": 590,
"y": 60,
"wires": []
},
{
"id": "f89aeeedf8f5e46b",
"type": "mqtt in",
"z": "aea09193ec9a7e2a",
"name": "",
"topic": "videoclip_test1",
"qos": "2",
"datatype": "auto",
"broker": "d25677b9.097f68",
"nl": false,
"rap": false,
"inputs": 0,
"x": 140,
"y": 320,
"wires": [
[
"9f742e8c39ddc986"
]
]
},
{
"id": "9f742e8c39ddc986",
"type": "image",
"z": "aea09193ec9a7e2a",
"name": "",
"width": 160,
"data": "payload",
"dataType": "msg",
"thumbnail": false,
"active": true,
"pass": false,
"outputs": 0,
"x": 370,
"y": 320,
"wires": []
},
{
"id": "694882bcdf8e3d8c",
"type": "inject",
"z": "aea09193ec9a7e2a",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 110,
"y": 600,
"wires": [
[
"70057cfec9b88995"
]
]
},
{
"id": "70057cfec9b88995",
"type": "exec",
"z": "aea09193ec9a7e2a",
"command": "export DISPLAY=:0 && uxterm -e python3 buffer_to_video.py -wd 704 -ht 576 -f 60 -fr 1 -cn /home/pi/clip1.avi -brt videoclip_test1 ",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 720,
"y": 600,
"wires": [
[],
[],
[]
]
},
{
"id": "746ee5747065054a",
"type": "inject",
"z": "aea09193ec9a7e2a",
"name": "Stop stream",
"props": [
{
"p": "stop",
"v": "true",
"vt": "bool"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"topic": "",
"x": 130,
"y": 230,
"wires": [
[
"f3f4481f8fa16397"
]
]
},
{
"id": "f3f4481f8fa16397",
"type": "multipart-decoder",
"z": "aea09193ec9a7e2a",
"name": "",
"ret": "bin",
"url": "",
"tls": "",
"authentication": "none",
"delay": 0,
"maximum": "1700000",
"blockSize": "1",
"enableLog": "off",
"x": 370,
"y": 180,
"wires": [
[
"ca34ed126ab14fef"
],
[]
]
},
{
"id": "d97b1790c0382bd6",
"type": "inject",
"z": "aea09193ec9a7e2a",
"name": "Working stream 2",
"props": [
{
"p": "url",
"v": "http://192.168.0.235:8081",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 140,
"y": 180,
"wires": [
[
"f3f4481f8fa16397"
]
]
},
{
"id": "ca34ed126ab14fef",
"type": "mqtt out",
"z": "aea09193ec9a7e2a",
"name": "",
"topic": "videoclip_test2",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "d25677b9.097f68",
"x": 590,
"y": 180,
"wires": []
},
{
"id": "76ad315691065e65",
"type": "inject",
"z": "aea09193ec9a7e2a",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 110,
"y": 660,
"wires": [
[
"0a811f8124664908"
]
]
},
{
"id": "0a811f8124664908",
"type": "exec",
"z": "aea09193ec9a7e2a",
"command": "export DISPLAY=:0 && uxterm -e python3 buffer_to_video.py -wd 1024 -ht 768 -f 15 -fr 1 -cn /home/pi/clip2.avi -brt videoclip_test2 ",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 720,
"y": 660,
"wires": [
[],
[],
[]
]
},
{
"id": "8afd3ccf4d243154",
"type": "mqtt in",
"z": "aea09193ec9a7e2a",
"name": "",
"topic": "videoclip_test2",
"qos": "2",
"datatype": "auto",
"broker": "d25677b9.097f68",
"nl": false,
"rap": false,
"inputs": 0,
"x": 590,
"y": 320,
"wires": [
[
"4b5ae3139c843352"
]
]
},
{
"id": "4b5ae3139c843352",
"type": "image",
"z": "aea09193ec9a7e2a",
"name": "",
"width": 160,
"data": "payload",
"dataType": "msg",
"thumbnail": false,
"active": true,
"pass": false,
"outputs": 0,
"x": 820,
"y": 320,
"wires": []
},
{
"id": "d25677b9.097f68",
"type": "mqtt-broker",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "",
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"sessionExpiry": ""
}
]