You are here

public function PHPVideoToolkit::setConstantQuality in Video 7.2

Same name and namespace in other branches
  1. 7 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::setConstantQuality()

Sets a constant quality value to the encoding. (but a variable bitrate)

Parameters

integer $quality The quality to adhere to. 100 is highest quality, 1 is the lowest quality:

File

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

Class

PHPVideoToolkit

Code

public function setConstantQuality($quality) {

  // 			interpret quality into ffmpeg value
  $quality = 31 - round($quality / 100 * 31);
  if ($quality > 31) {
    $quality = 31;
  }
  elseif ($quality < 1) {
    $quality = 1;
  }
  return $this
    ->addCommand('-qscale', $quality);
}