I want to use fluent-ffmpeg
to create videos from the last n directory images or database entries.
What is the correct syntax?
These are my attempts:
Mimic shell team
ffmpeg() .addInput('ls *png | tail -n 17') .inputOptions("-pattern_type glob") .output("output.mp4").run()
but it does not accept shell commands;
space separated paths
ffmpeg() .addInput('a*.png b*.png ') .inputOptions("-pattern_type glob") .output("output.mp4").run()
but it does not accept a list of files separated by spaces;
Array of image paths
ffmpeg() .addInput(array) // ['aa.png', 'a1.png',,,'bbb.png'] .inputOptions("-pattern_type glob") .output("output.mp4").run()
but it does not accept arrays.
EDIT:
Also, from Merge multiple videos using node fluent ffmpeg , I can add multiple inputs using an array of files, like
var ffmpeg= require('fluent-ffmpeg'); var f=ffmpeg() pngarr.forEach(p => f.input(p))
But the launch
f.output("./output.mp4").run()
I only get videos from 0 seconds containing the first png list.
source share