You are here

public function PHPVideoToolkit::setVideoAspectRatio in Video 7.2

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

Sets the video aspect ratio. IMPORTANT! Setting an aspect ratio will change the width of the video output if the specified dimensions aren't already in the correct ratio. ie, Setting the aspect ratio to RATIO_STANDARD when you set the output dimensions to 176 x 144 will in fact output a video with 192 x 144, but the information returned by ffmpeg will give return the size as 176 x 144 which is obviously invalid.

@access public

Parameters

string|integer $ratio Valid values are PHPVideoToolkit::RATIO_STANDARD, PHPVideoToolkit::RATIO_WIDE, PHPVideoToolkit::RATIO_CINEMATIC, or '4:3', '16:9', '1.85':

Return value

boolean

File

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

Class

PHPVideoToolkit

Code

public function setVideoAspectRatio($ratio) {
  if (!in_array($ratio, array(
    self::RATIO_STANDARD,
    self::RATIO_WIDE,
    self::RATIO_CINEMATIC,
  ))) {
    return $this
      ->_raiseError('setVideoAspectRatio_valid_ratio', array(
      'ratio' => $ratio,
    ));
  }
  $this
    ->addCommand('-aspect', $ratio);
  return TRUE;
}