code: function getScalePadFilters(width, height, aspect, color) {
    /*
      let a be the input aspect ratio, A be the requested aspect ratio
  
      if a > A, padding is done on top and bottom
      if a < A, padding is done on left and right
     */
  
    return [
      /*
        In both cases, we first have to scale the input to match the requested size.
        When using computed width/height, we truncate them to multiples of 2
       */
      {
        filter: 'scale',
        options: {
          w: 'if(gt(a,' + aspect + '),' + width + ',trunc(' + height + '*a/2)*2)',
          h: 'if(lt(a,' + aspect + '),' + height + ',trunc(' + width + '/a/2)*2)'
        }
      },
  
      /*
        Then we pad the scaled input to match the target size
        (here iw and ih refer to the padding input, i.e the scaled output)
       */
  
      {
        filter: 'pad',
        options: {
          w: width,
          h: height,
          x: 'if(gt(a,' + aspect + '),0,(' + width + '-iw)/2)',
          y: 'if(lt(a,' + aspect + '),0,(' + height + '-ih)/2)',
          color: color
        }
      }
    ];
  }
docs: /*
  ! Size helpers
   
  Return filters to pad video to width*height,
  
  @param {Number} width output width
  @param {Number} height output height
  @param {Number} aspect video aspect ratio (without padding)
  @param {Number} color padding color
  @return scale/pad filters
  @private