node ffmpeg 视频操作
1,先安装ffmpeg
2,设置环境变量
3,npm install fluent-ffmpeg
4,编码
var ffmpeg = require('fluent-ffmpeg');
//视频合并
var file1 = "3.mp4";
var file2 = "2.mp4";
var outPath = "out.mp4";
var proc = ffmpeg(file1)
.input(file2).mergeToFile(outPath);
//视频缩放,指定宽高
ffmpeg('./3.mp4')
.size('50%')
.withSize('1600x900')
.save('./outputfile.mp4');