You are here

private function PHPVideoToolkit::checkVideoSize in Video 7.2

Adjust size to be a multiple of a given integer.

Parameters

integer $size:

integer $multiple:

Return value

integer How much to pad on each end to make the adjustment.

1 call to PHPVideoToolkit::checkVideoSize()
PHPVideoToolkit::setVideoDimensions in libraries/phpvideotoolkit/phpvideotoolkit.php5.php
Sets the video output dimensions (in pixels)

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 1608
Libary to access FFmpeg

Class

PHPVideoToolkit

Code

private function checkVideoSize($size, $multiple) {
  $extra = 0;
  if ($multiple > 0 && $size % $multiple != 0) {

    // Round up
    $size_adj = (int) (($size + $multiple - 1) / $multiple) * $multiple;
    $extra = (int) (($size_adj - $size) / 4) * 2;
  }
  return $extra;
}