I'm currently working on a online video website and i need to make a quick preview of videos using random timestamps and duration of the video.
Suppose the video is of 15 min then i want to cut out some parts like ->
1. from 00:00:40 take out next 2s
2. from 00:01:20 take out next 2s
3. ... and so on until the new video becomes 15s
How can i do this with fluent-ffmpeg in the nodejs project
Can i get the most efficient way of doing this without writing many output files and then concating them separately and removing then later
Only concating the trimmed videos in one output file and save when it is done.
I also came through a solution that uses complex filters but i don't know how to use it
ffmpeg("video.mp4")
.complexFilter([
....// some filters here
])
.on('end', function () {
console.log('files have been merged and saved.')
})
.on('error',function (err){
console.log(err)
}
.saveToFile("output.mp4")```