Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

implemented code by @bnerd posted in #89

  • Loading branch information...
commit d963553454a3a117930b66b8b7bd5fa9ed67711a 1 parent 4bbf8f1
@schaermu schaermu authored
Showing with 19 additions and 7 deletions.
  1. +19 −7 lib/processor.js
View
26 lib/processor.js
@@ -681,14 +681,26 @@ exports = module.exports = function Processor(command) {
if (this.options.video.pad && !this.options.video.skip) {
// we have padding arguments, push
+ // padding is not supported ffmpeg < 0.7 (only using legacy commands which were replaced by vfilter calls)
if (this.atLeastVersion(meta.ffmpegversion, '0.7')) {
- // padding is not supported ffmpeg < 0.7 (only using legacy commands which were replaced by vfilter calls)
- args.push('-vf');
- args.push('pad=' + this.options.video.pad.w +
- ':' + this.options.video.pad.h +
- ':' + this.options.video.pad.x +
- ':' + this.options.video.pad.y +
- ':' + this.options.video.padcolor);
+ // if we want to resize and pad in the same step, we have to do it all using vfilters
+ if (this.options.video.size) {
+ args.push('-vf');
+ args.push('scale=' + this.options.video.size +
+ ',pad=' + this.options.video.pad.w +
+ ':' + this.options.video.pad.h +
+ ':' + this.options.video.pad.x +
+ ':' + this.options.video.pad.y +
+ ':' + this.options.video.padcolor);
+ } else {
+ args.push('-vf');
+ args.push('pad=' + this.options.video.pad.w +
+ ':' + this.options.video.pad.h +
+ ':' + this.options.video.pad.x +
+ ':' + this.options.video.pad.y +
+ ':' + this.options.video.padcolor);
+ }
+
} else {
return new Error("Your ffmpeg version " + meta.ffmpegversion + " does not support padding");
}
Please sign in to comment.
Something went wrong with that request. Please try again.