You are here

public function PHPVideoToolkit::validateCodec in Video 7.2

Same name and namespace in other branches
  1. 7 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.:

$type string either 'video', 'audio', or 'subtitle'. The type of codec to check for.:

$method string 'encode' or 'decode', The method to check against the codec:

Return value

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 2625
Libary to access FFmpeg

Class

PHPVideoToolkit

Code

public function validateCodec($codec, $type, $method) {
  $info = $this
    ->getFFmpegInfo();
  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;
}