瀏覽代碼

add a video filter to the ffmpeg incantation to ensure that the output frame is always a power of 2 which is required by the codec

Ken Bingham 6 年之前
父節點
當前提交
dece601e87
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      audiogram/combine-frames.js

+ 1 - 1
audiogram/combine-frames.js 查看文件

@@ -4,7 +4,7 @@ function combineFrames(options, cb) {
4 4
 
5 5
   // Raw ffmpeg command with standard mp4 setup
6 6
   // Some old versions of ffmpeg require -strict for the aac codec
7
-  var cmd = "ffmpeg -r " + options.framesPerSecond + " -i \"" + options.framePath + "\" -i \"" + options.audioPath + "\" -c:v libx264 -c:a aac -strict experimental -shortest -pix_fmt yuv420p \"" + options.videoPath + "\"";
7
+  var cmd = "ffmpeg -r " + options.framesPerSecond + " -i \"" + options.framePath + "\" -i \"" + options.audioPath + "\" -c:v libx264 -c:a aac -strict experimental -shortest -pix_fmt yuv420p -vf 'scale=trunc(iw/2)*2:trunc(ih/2)*2' \"" + options.videoPath + "\"";
8 8
 
9 9
   exec(cmd, cb);
10 10