From cd5fe439058ebd617affe0fa6c9387a6006cc333 Mon Sep 17 00:00:00 2001 From: Jerome Wu Date: Sun, 26 Apr 2020 15:43:06 +0800 Subject: [PATCH] Add hstack example --- examples/node/hstack.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 examples/node/hstack.js diff --git a/examples/node/hstack.js b/examples/node/hstack.js new file mode 100755 index 0000000..41aa39c --- /dev/null +++ b/examples/node/hstack.js @@ -0,0 +1,17 @@ +const fs = require('fs'); +const { createWorker } = require('../../src'); + +const worker = createWorker({ + logger: ({ message }) => console.log(message), +}); + +(async () => { + await worker.load(); + console.log('Start hstack'); + await worker.write('flame.avi', '../../tests/assets/flame.avi'); + await worker.run('-i flame.avi -i flame.avi -filter_complex hstack flame.mp4'); + const { data } = await worker.read('flame.mp4'); + console.log('Complete hstack'); + fs.writeFileSync('flame.mp4', Buffer.from(data)); + await worker.terminate(); +})();