fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.85k stars 874 forks source link

Fluent ffmpeg performance #610

Open fcb2 opened 7 years ago

fcb2 commented 7 years ago

Hi. I am generating video from a series of images.

var startTime; proc.addInput(//path to a text file).withInputFormat(//some format) .addInput(//audioFilePath) .addOptions(//some options) .on(start,function(command){ var endtTime; totalTime=endTime-startTime
} .output(//outputPath).run();

I have added time loggers, totalTime is captured on fire of start event and it comes ~10-12 seconds. Is it normal to take this much of time to spawn ffmpeg process? I am having 8G RAM with 64 bit OS and 2.70GHz processor

fcb2 commented 7 years ago

Also, if i am spawning 20 threads in parallel, with each thread being spawned in one second, performance deteriorates. Time taken by fluent to spawn ffmpeg for the first thread comes around 25-26 seconds. The code gets stuck at proto._prepare function of processor.js file, maybe between the series of functions written in async.waterfall Is this expected behaviour? Is there any performance tuning that we can do? Am fairly new to node.

njoyard commented 7 years ago

Sorry, I don't have much time to investigate this currently. It seems indeed that preparation takes a long time (maybe ffprobe calls on each input ?) and it does not look normal.

fcb2 commented 7 years ago

Yes maybe. Look in to it whenever you get time. :)