Resolve conflict

This commit is contained in:
Первов Артем
2026-06-04 15:08:29 +03:00

View File

@@ -241,15 +241,15 @@
"id": "a2", "id": "a2",
"type": "function", "type": "function",
"z": "f1a1b1c1d1e1f1a1", "z": "f1a1b1c1d1e1f1a1",
"name": "build ffmpeg args", "name": "prepare ffmpeg args",
"func": "msg.payload = '-hide_banner -loglevel error -rtsp_transport tcp ' +\n '-i \"rtsp://admin:admin@192.168.0.11:554/live/main\" ' +\n '-an -c copy -f mpegts pipe:1';\nreturn msg;", "func": "msg.payload = '-hide_banner -loglevel error -rtsp_transport tcp ' +\n '-i \"rtsp://127.0.0.1:8554/webcam\" ' +\n '-an -c copy -f mpegts pipe:1';\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": "", "timeout": "",
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 340, "x": 360,
"y": 100, "y": 100,
"wires": [ "wires": [
[ [
@@ -269,19 +269,15 @@
"winHide": false, "winHide": false,
"oldrc": false, "oldrc": false,
"name": "ffmpeg spawn", "name": "ffmpeg spawn",
"x": 560, "x": 600,
"y": 100, "y": 100,
"wires": [ "wires": [
[ [
"a4", "a4",
"a7" "a7"
], ],
[ [],
"a5" []
],
[
"a6"
]
] ]
}, },
{ {
@@ -292,7 +288,7 @@
"func": "if (Buffer.isBuffer(msg.payload)) {\n msg.chunkLength = msg.payload.length;\n msg.payload = {\n chunkLength: msg.chunkLength,\n headHex: msg.payload.subarray(0, Math.min(32, msg.payload.length)).toString('hex')\n };\n}\nreturn msg;", "func": "if (Buffer.isBuffer(msg.payload)) {\n msg.chunkLength = msg.payload.length;\n msg.payload = {\n chunkLength: msg.chunkLength,\n headHex: msg.payload.subarray(0, Math.min(32, msg.payload.length)).toString('hex')\n };\n}\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"x": 770, "x": 890,
"y": 80, "y": 80,
"wires": [ "wires": [
[ [
@@ -300,36 +296,6 @@
] ]
] ]
}, },
{
"id": "a5",
"type": "debug",
"z": "f1a1b1c1d1e1f1a1",
"name": "ffmpeg stderr/log",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"x": 790,
"y": 120,
"wires": []
},
{
"id": "a6",
"type": "debug",
"z": "f1a1b1c1d1e1f1a1",
"name": "ffmpeg rc",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"x": 760,
"y": 160,
"wires": []
},
{ {
"id": "a7", "id": "a7",
"type": "delay", "type": "delay",
@@ -347,8 +313,8 @@
"drop": true, "drop": true,
"allowrate": false, "allowrate": false,
"outputs": 1, "outputs": 1,
"x": 760, "x": 860,
"y": 220, "y": 160,
"wires": [ "wires": [
[ [
"a9" "a9"
@@ -366,7 +332,9 @@
"tostatus": true, "tostatus": true,
"complete": "payload", "complete": "payload",
"targetType": "msg", "targetType": "msg",
"x": 990, "statusVal": "payload",
"statusType": "auto",
"x": 1130,
"y": 80, "y": 80,
"wires": [] "wires": []
}, },
@@ -374,6 +342,7 @@
"id": "a9", "id": "a9",
"type": "http request", "type": "http request",
"z": "f1a1b1c1d1e1f1a1", "z": "f1a1b1c1d1e1f1a1",
"d": true,
"name": "send chunk to cloud", "name": "send chunk to cloud",
"method": "POST", "method": "POST",
"ret": "txt", "ret": "txt",
@@ -386,8 +355,8 @@
"authType": "", "authType": "",
"senderr": false, "senderr": false,
"headers": [], "headers": [],
"x": 990, "x": 1090,
"y": 220, "y": 160,
"wires": [ "wires": [
[ [
"b1" "b1"
@@ -405,8 +374,8 @@
"tostatus": true, "tostatus": true,
"complete": "payload", "complete": "payload",
"targetType": "msg", "targetType": "msg",
"x": 1200, "x": 1300,
"y": 220, "y": 160,
"wires": [] "wires": []
}, },
{ {
@@ -414,15 +383,15 @@
"type": "exec", "type": "exec",
"z": "f1a1b1c1d1e1f1a1", "z": "f1a1b1c1d1e1f1a1",
"command": "taskkill", "command": "taskkill",
"addpay": "", "addpay": "payload",
"append": "/IM ffmpeg.exe /F", "append": "/T /F",
"useSpawn": "false", "useSpawn": "false",
"timer": "", "timer": "",
"winHide": false, "winHide": false,
"oldrc": false, "oldrc": false,
"name": "", "name": "ffmpeg task kill",
"x": 310, "x": 600,
"y": 220, "y": 380,
"wires": [ "wires": [
[], [],
[], [],
@@ -450,12 +419,66 @@
"topic": "", "topic": "",
"payload": "", "payload": "",
"payloadType": "date", "payloadType": "date",
"x": 110, "x": 130,
"y": 220, "y": 380,
"wires": [
[
"5e118756b72c6f1a"
]
]
},
{
"id": "718c866ef4aacbe3",
"type": "function",
"z": "f1a1b1c1d1e1f1a1",
"name": "get process identifier",
"func": "if (msg.status && msg.status.text) {\n const m = msg.status.text.match(/^pid:(\\d+)/);\n if (m) {\n flow.set(\"ffmpeg-pid\", Number(m[1]));\n }\n}\nreturn null;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 240,
"wires": [
[]
]
},
{
"id": "5e118756b72c6f1a",
"type": "function",
"z": "f1a1b1c1d1e1f1a1",
"name": "prepare task killer args",
"func": "const pid = flow.get(\"ffmpeg-pid\");\nif (!pid) {\n node.warn(\"ffmpeg-pid not set, skip taskkill\");\n return null;\n}\nmsg.pid = pid;\nmsg.payload = `/PID ${pid}`;\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 380,
"wires": [ "wires": [
[ [
"dfbb81298270d1d0" "dfbb81298270d1d0"
] ]
] ]
},
{
"id": "048a38e744556fc1",
"type": "status",
"z": "f1a1b1c1d1e1f1a1",
"name": "get stream status",
"scope": [
"a3"
],
"x": 120,
"y": 240,
"wires": [
[
"718c866ef4aacbe3"
]
]
} }
] ]