I'm trying to convert a series of .ts files into one mp4 file in using ffmpeg via a node execute:
var combineVideo = function (videoFiles, fileName, callback) {
var videoDone = _.after(videoFiles.length, function () {
var ffmpegcommand = 'ffmpeg -i "concat:';
ffmpegcommand += _.inject(videoFiles, function (command, name, i) {
return command + process.env.UPLOAD_PATH + fileName + '-' + i + '.ts|';
}, '');
ffmpegcommand = ffmpegcommand.substring(0, ffmpegcommand.length - 1);
ffmpegcommand += '" -c copy -bsf:a aac_adtstoasc -strict -2 ' + process.env.UPLOAD_PATH + fileName + 'combined-video.mp4';
exec(ffmpegcommand, function (error, stdout, stderr) {
if (error) {
logger.error(error);
}
_.each(videoFiles, function (v, i) {
fs.unlink(process.env.UPLOAD_PATH + fileName + '-' + i + '.ts');
});
callback();
});
});
_.each(videoFiles, function (file, i) {
convertWebmToMp4(fileName + '-' + i, videoDone);
});
I've logged the command before executing it as such:
combining video /usr/bin/ffmpeg -i "concat:./uploads/db42ab00-4140-11e5-83dd-936f6cb4a63a-0.ts|./uploads/db42ab00-4140-11e5-83dd-936f6cb4a63a-1.ts" -c copy -bsf:a aac_adtstoasc -strict -2 ./uploads/db42ab00-4140-11e5-83dd-936f6cb4a63acombined-video.mp4
The error message I receive is:
{ [Error: Command failed: ffmpeg version 2.5.7-0ubuntu0.15.04.1 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
[aac @ 0x8ae8c0] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it. ] killed: false, code: 1, signal: null }
However, the exact ffmpeg command already has the -strict -2 flags and it runs just fine either on the command line or via a separate .js file. I am very stumped.