要求是读取目录中的所有文件并合并它们.我正在使用node fluent-ffmpeg来实现这一目标.首先,通过添加来读取连接字符串的目录中的所有文件.input.
var finalresult="E:/ETV/videos/finalresult.mp4"
outputresult : It consists of all the files read in the directory.
/*Javascript*/
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);
}
Run Code Online (Sandbox Code Playgroud)
它给出以下错误:
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 …Run Code Online (Sandbox Code Playgroud)