Demand
consists in reading all the files in a directory and combining them. For this I use node fluent-ffmpeg. First of all, after reading all the files in the directory, adding the string concatenation, adding .input
.
var finalresult="E:/ETV/videos/finalresult.mp4" outputresult : It consists of all the files read in the directory. MergeVideo(outputresult); function MergeVideo(outputresult){ console.log("in merge video"); var videostring = ""; for(i=1;i<5;i++) { videostring = videostring+".input("+"'"+outputresult[i]+"'"+")"; } console.log("Video String"+videostring); var proc = ffmpeg()+videostring .on('end', function() { console.log('files have succesfully Merged'); }) .on('error', function(err) { console.log('an error happened: ' + err.message); }) .mergeToFile(finalresult); }
It produces the following error:
TypeError: Object .input('ETV 22-02-2015 1-02-25 AM.mp4').input('ETV 22-02-2015 9-33-15 PM.mp4').input('ETV 22-02-2015 9-32-46 AM.mp4').input('ETV 22-02-2015 8- 32-44 AM.mp4') has no method 'on' at MergeVideo (D:\Development\Node\node-fluent-ffmpeg-master\node-fluent-ffm peg-master\examples\demo.js:140:6) at Object.<anonymous> (D:\Development\Node\node-fluent-ffmpeg-master\node-fl uent-ffmpeg-master\examples\demo.js:129:1) at Module._compile (module.js:456:26)
Any help is appreciated.
source share