public static function PHPVideoToolkit::getAvailableCodecs in Video 7
Same name and namespace in other branches
- 7.2 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::getAvailableCodecs()
* Returns the available codecs. * @access public *
Parameters
mixed $type The type of codec list to return, false (to return all codecs), or either 'audio', 'video', or 'subtitle'.: * @return array An array of codecs available to ffmpeg.
File
- libraries/
phpvideotoolkit/ phpvideotoolkit.php5.php, line 2961
Class
Code
public static function getAvailableCodecs($type = false) {
// 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);
}
// are we checking for particluar method?
$return_vals = array();
if ($type === false) {
$video_keys = array_keys($info['codecs']['video']);
$audio_keys = array_keys($info['codecs']['audio']);
$subtitle_keys = array_keys($info['codecs']['subtitle']);
return array_merge($video_keys, $audio_keys, $subtitle_keys);
}
return isset($info['codecs'][$type]) === true ? array_keys($info['codecs'][$type]) : false;
}