A Node-RED node to executed ffmpeg commands via WebAssembly (WASM)
APACHE-2.0 License
A Node-RED node to executed ffmpeg commands via WebAssembly (WASM)
Run the following npm command in your Node-RED user directory (typically ~/.node-red):
npm install bartbutenaers/node-red-contrib-ffmpeg-wasm
*CAUTION: As this node uses worker_threads
which was introduced in Node.js v10.5.0, please remember to add --experimental-worker
if you are using Node.js v10, and you don't have to add anything if you are using Node.js v12!
[{"id":"270cbbba.0d9eb4","type":"ffmpeg_wasm","z":"b25092e6.f35db","name":"","command":"-i rip.jpg rip.bmp","bindings":[{"direction":"input","field":"payload","filename":"rip.jpg"},{"direction":"output","field":"payload","filename":"rip.bmp"}],"x":930,"y":140,"wires":[["acc20237.4920b"],["9f8763e6.2bdf9"]]},{"id":"a402186.85ae3e8","type":"http request","z":"b25092e6.f35db","name":"","method":"GET","ret":"bin","paytoqs":false,"url":"https://upload.wikimedia.org/wikipedia/commons/e/e0/JPEG_example_JPG_RIP_050.jpg","tls":"","persist":false,"proxy":"","authType":"","x":750,"y":160,"wires":[["270cbbba.0d9eb4"]]},{"id":"92c477c3.e12488","type":"inject","z":"b25092e6.f35db","name":"Convert image","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":540,"y":160,"wires":[["a402186.85ae3e8"]]},{"id":"acc20237.4920b","type":"image","z":"b25092e6.f35db","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":false,"active":true,"x":1160,"y":40,"wires":[]},{"id":"1ae3a57f.cf12eb","type":"inject","z":"b25092e6.f35db","name":"Start worker","topic":"start_worker","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":60,"wires":[["270cbbba.0d9eb4"]]},{"id":"a31ab623.39dbc8","type":"inject","z":"b25092e6.f35db","name":"Stop worker","topic":"stop_worker","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":100,"wires":[["270cbbba.0d9eb4"]]},{"id":"9f8763e6.2bdf9","type":"debug","z":"b25092e6.f35db","name":"Show worker status","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":1160,"y":240,"wires":[]}]
The ffmpeg command to be used. When the command contains filenames, this will be virtual in-memory files! It are not physical files on the filesystem of the host!
Remark: It doesn't matter whether the command starts with ffmpeg or not...
When selected, the background worker will be started automatically at startup (or after a deploy). When not selected, the background worker needs to be started by injecting a message with msg.topic = "start_worker"
When filenames are being used in the ffmpeg command, those virtual files need to be binded to fields in the input/output messags. Add a binding rule for each virtual file: