You are here

public static function PHPVideoToolkit::validateCodec in Video 7

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

* Checks to see if a given codec can be decoded/encoded by the current ffmpeg binary. * @access public *

Parameters

$codec string The shortcode for the codec to check for.: * @param $type string either 'video', 'audio', or 'subtitle'. The type of codec to check for. * @param $method string 'encode' or 'decode', The method to check against the codec * @return boolean True if the codec can be used with the given method by ffmpeg, otherwise false.

2 calls to PHPVideoToolkit::validateCodec()
PHPVideoToolkit::canCodecBeDecoded in libraries/phpvideotoolkit/phpvideotoolkit.php5.php
* Checks to see if a given codec can be decoded by the current ffmpeg binary. * @access public *
PHPVideoToolkit::canCodecBeEncoded in libraries/phpvideotoolkit/phpvideotoolkit.php5.php
* Checks to see if a given codec can be encoded by the current ffmpeg binary. * @access public *

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 2841

Class

PHPVideoToolkit

Code

public static function validateCodec($codec, $type, $method) {

  // 			check to see if this is a static call
  if (isset($this) === false) {
    $toolkit = new PHPVideoToolkit();
    $info = $toolkit
      ->getFFmpegInfo(true);
  }
  else {
    $info = $this
      ->getFFmpegInfo(true);
  }
  return isset($info['codecs'][$type]) === true && isset($info['codecs'][$type][$codec]) === true && isset($info['codecs'][$type][$codec][$method]) === true ? $info['codecs'][$type][$codec][$method] : false;
}